Last active
May 26, 2017 06:47
-
-
Save rajendra89/c2860b42f583c62d9442038e8e75661c to your computer and use it in GitHub Desktop.
accessing page content through loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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