Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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;
    print_r($post);
  }

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
1  
Not making much sense, what are you aiming to do? ie. What's the end goal? –  t31os Jul 28 '11 at 15:09
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.