Forums

Page template that grabs content according to page ID (3 posts)

  1. desmondo
    Member
    Posted 2 years ago #

    HI all,

    I've created a page template for my site that will use multiple pages for it's content. I have a few if statements to change the HTML link active states according to the current page ID.

    I would also like to change the loop to only pull in content from a particular page ID (eg - 57) when necessary. Can anyone tell me how to do this? I have been searching for a while:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php the_content('<p class="serif">Read the rest of this page »</p>'); ?>

  2. desmondo
    Member
    Posted 2 years ago #

    Bump, no-one knows the answer to this?

  3. mahalie
    Member
    Posted 2 years ago #

    Since you're only displaying one page use the_ID(); to get the page ID, as seen in the page.php template.

Topic Closed

This topic has been closed to new replies.

About this Topic