Go to Top

Displaying a Single WordPress Page

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:

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!

, , , , ,

5 Responses to "Displaying a Single WordPress Page"

  • Francesco Banda Jasso
    October 26, 2012 - 7:45 pm Reply

    Thanks for your nice experience to share with us. Really awesome article with plenty of informative things to be known for us.

    • Jo
      November 7, 2012 - 8:19 pm Reply

      I’m glad its helped!

  • Vitaly Izmailova
    October 24, 2012 - 10:30 pm Reply

    Terrific work! This is the type of information that should be shared around the web. Shame on the search engines for not positioning this post higher!

  • Andrea A Johnson
    October 13, 2012 - 4:57 am Reply

    Just as good as your last post. Do you accept advertisers?

    • Jo
      November 7, 2012 - 8:23 pm Reply

      thanks for your comment. I don’t accept advertisers sorry.

Leave a Reply

Your email address will not be published. Required fields are marked *

9 − six =