Skip to content

Instantly share code, notes, and snippets.

@rajendra89
Last active May 26, 2017 06:47
Show Gist options
  • Save rajendra89/c2860b42f583c62d9442038e8e75661c to your computer and use it in GitHub Desktop.
Save rajendra89/c2860b42f583c62d9442038e8e75661c to your computer and use it in GitHub Desktop.
accessing page content through loop
siteURL/wp-admin/post.php?post=37&action=edit
Here, 37 is page ID.
<?php $the_query = new WP_Query( 'page_id=37' );
while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
//Content Area.
//Example use the_content(); to display page content.
//Example use the_title(); to display page title.
//Example use the_post_thumbnail(); to display page's featured image,
if you are usgin inside img tag then <img src="<?php the_post_thumbnail_url(); ?>">
<?php endwhile; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment