Not exactly sure what you are trying to accomplish, but it looks like you are trying to prepend something to the beginning of the_content.
Try this:
add_filter('the_content', 'se24265_my_function');
function se24265_my_function( $content )
{
$write="hello world";
$new_content = $write . $content;
return $new_content;
}
Most filters will provide a parameter or two for your function to manipulate and then return.
Related Posts:
- Extract image from content and set it as the featured image
- Remove image from post_content on save_post
- Make WordPress size and name images for Retina.js
- WordPress function/template tag to get first n words of the content
- Pinterest Integration Using functions.php
- Allowing SVG uploads in media uploader without plug-in
- Unable to get_the_content(); of a post in WordPress via AJAX
- Automatically wrap multiple images in div
- How can I add text to all posts/pages/categories/homepage etc
- Display post shortcode content in the sidebar?
- If user is logged-in display/hide something
- Tags break custom Excerpt function
- the_excerpt function not showing image
- What is best practices to move the following code into a function?
- Regex works in regexr, but not if I filter content [closed]
- Problem in outputting shortcode
- Problem in shortcode outputting content
- Integrating custom API for post content into Admin interface & Public Website [closed]
- Trying to get this function to show below the content
- get php variable from functions php and echo it in theme template files [closed]
- Use AJAX in shortcode
- Remove Container Element From wp_nav_menu() Markup
- WordPress function like is_category for subcategory? is_subcategory?
- WordPress Theme Update Action?
- Using a private method as an action callback from within a class
- Auto close (hide) custom metabox / set default state
- Does WordPress Development Mode Exist (with not minified JS)?
- WP_Query in functions.php
- wp_delete_user with username
- what is the meaning of settings_fields()
- Organize functions.php
- How to activate “Description” metabox for menu item programmatically?
- Change labels on ‘Nickname’ and ‘Biographical Info’ in user-edit.php
- Breadcrumb how i can display page title with parent > child title with permalink ? any Idea
- change a post status when users update posts?
- How often is functions.php loaded?
- Display height and width properties with the_post_thumbnail() or related function
- Cleaner way to access custom fields in code?
- Add a new subscriber role using a function
- Display a text message if the shortcode is found?
- How to store / access files in child theme folder
- How to set the jpg image compression for specific thumbnail sizes?
- How to use IF Statement in WordPress?
- Woocommerce Storefront WordPress Ignore Media Gallery Images and use External 3rd Party Host
- How would go about if I just want a temporary function?
- How do I edit wp_head and/or functions.php to remove rss-feed which isnt used and dont validate?
- Custom HTML in specific category single page and its descendant categories
- Modify a function without editing template
- How to hide unused profile fields?
- Override widget in function WordPress
- How to change or add user role after getting post request data about pay? [closed]
- How to properly remove style for non logged in and front page only
- WordPress converts media extention URL automatically to video player
- Automatically include all php files in a child theme directory
- How do you Permanently Delete Sidebars
- Add a unique class to HTML tag/element
- Removing specific menu items?
- Which function required?
- AJAX error handling for submit function in functions file
- get_pages() Returns Only One Item
- Custom Query Not Paginating
- Use a shortcode to display custom meta box contents
- Solved: redirect to another page using functions.php
- Getting the teaser text without overriding global variables
- Solution dealing with Child Theme / Parent theme functions
- Function to pull data from user meta not working
- referencing the current user in a page i created in wordpress
- Counting posts and trigger it [closed]
- is_product_category(‘Services’) not working
- Replace theme function
- How to access custom class methods from any include without using global
- Is it possible to use ‘wp_insert_post’ function within a for loop?
- save_post function keeps triggering: Warning: array_map(): Argument #2 should be an array… when restoring from trash
- More than one search results page template for two searches on site
- How do i create a search option for pdf’s only
- Redirect after login to current URL
- Restrict certain roles registrations by domain
- Replacing term/taxonomy archive pages with search queries
- Return ACF Field value function
- Best way to add image to recent posts widget?
- Function to draw random image from specified category destroys site logic – why?
- Issues with add_query_arg() not passing a variable
- wp_enqueue_script only works outside of action
- How can I include user meta information in the resulting array of a WP_User_Query?
- How to add next height number in Order Attributes inside the Add new page. [duplicate]
- Force changing the Site Title and add link
- create submenu page – error function not found or invalid function name
- Get Value of Custom Field
- Undefined offset: 2
- Sorting date results from a query
- Using is_plugin_active within functions.php
- Add title & subtitle to shortcodes
- Button generate a random URL [closed]
- How to Delete Posts by title?
- How do I add functionality to images?
- Display function from functions.php in tag.php
- AJAX values converted to PHP Variables?
- Load script only on selected Pages
- Using input_attrs() Multiple Times Within One Customizer Control
- Convert Image to Webp on upload without plugin