Take the 2-minute tour ×

Now i face a problem, that i want to add a hook into the the_post. Then i use print_r($post); here display the my print_r content and again display the default content. because i am here in the_loop.so again the content was display.

add_action( 'the_content',  'custom_post' );

  function custom_post() {
    global $post, $wp_query;
    $post_id = $post->ID;

Here i need how to overwrite the default content of the the_post and display my own content.

This is possible in a way, that i use the_title and the_content hook but here the function was call two times then its problem. so plz help me.

share|improve this question
Not making much sense, what are you aiming to do? ie. What's the end goal? –  t31os Jul 28 '11 at 15:09

1 Answer 1

up vote 1 down vote accepted

Take a look at my answer here, if you are trying to replace the post content:

Edit the_content function

share|improve this answer

Your Answer


