To display blog post in wordpress at custom place we can use these kind of syntax. See the example mentioned below.
<?php
$post = get_post($id); //assume $id has been initialized
setup_postdata($post);
// display the post data of blog here
the_title(); //for title
the_excerpt();
the_post_thumbnail();
wp_reset_postdata();
?>
<?php
$post = get_post($id); //assume $id has been initialized
setup_postdata($post);
// display the post data of blog here
the_title(); //for title
the_excerpt();
the_post_thumbnail();
wp_reset_postdata();
?>
No comments:
Post a Comment