0

I need to display post details by ID on front page template (front-page.php).

On the front page I want to display the post’s title, excerpt & featured image. I have tried to do that but no idea on how I should be doing that.

Is there any function in WordPress that can be used to do it?

1
  • 1
    Please show us your code and what you've tried so far.
    – kaiser
    Oct 25 '12 at 13:22
5

You can use get_post for that

Example:

<?php
$post = get_post($id); //assuming $id has been initialized
setup_postdata($post);

// display the post here
the_title();
the_excerpt();
the_post_thumbnail();

wp_reset_postdata();
?>
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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