Find out about displaying a single wordpress page in any of your wordpress themes.
I was quite amazed today when I was trying to show a single page of my wordpress website however I couldnt figure out the code.
Surprisingly there were not many posts which explained how go about displaying a single wordpress page, so I figure I should share it with anyone else wanting to know how to do this.
Firstly you will need the page ID number of the page you want to display.
To get this follow these instructions:
1) In your wordpress administration area go to Pages > All Pages then click edit under the page you want to edit.
2) Look in your address bar of your browser, it should look roughly like something along these lines:
3) Make a note of the post=1234 number – this is your page ID.
Once you have your page ID you need to find open up the file where you want to show this page in a html editor (notepad/notepad++/dreamweaver) (just to name a few).
Find where you want to show your post and insert the following code:
<?php query_posts('page_id=1234'); /*Replace the number after page_id with your page's ID number*/ if(have_posts) : the_post(); /*Start the loop of getting the page*/ the_content(); /*Show the page content*/ endif; /*end loop*/ ?>
That’s it, upload your file and preview your changes.
Hopefully guide will have helped some people to get to the point of displaying a single wordpress page!