Support » Fixing WordPress » Page not showing “page content”, but most recent blog post

  • Resolved oldwebgeek


    I’ve recently setup and installed WP 2.04 and verified that mod_rewrite works and .htaccess is writeable (chmod 666). My blog post permalinks work just fine. However, when I create a new WP Page using the page template, the content that appears on the page is actually the most recent blog post, not the Page content.

Viewing 15 replies - 1 through 15 (of 16 total)
  • A link to your site would be useful.

    My aplogies:

    URL to blog home page:

    URL of the test page that shows the blog post instead of page content:

    Nice site.
    I don’t have any idea. What happens when you edit the “page”?
    Also what is the post slug for that page?

    When I edit the page, I can see the Page’s content in the text editor just fine. The post slug is automatically created by WP when the Page is first created.

    It’s when I attempt to view the Page, using the URL created by WP, that I see the Page load with the most recent post instead of the Page content.

    UPDATE: I double-checked the .htaccess file and it never gets updated by WP whenever a new page is created. I verified that it is write-able so I’m really not sure how to solve this problem.

    Any assistance would be greatly appreciated.

    UPDATE II: Even when trying to access the Page with permalinks turned off (using the ?page_id= parameter), the content that displays on the Page is still the most recent Post, not the Page’s content.

    The page content shows up properly using the WP default and classic themes.

    I compared the Page template code from my themes page to that of the other themes and they are identical. Every major template tag is present in my Page theme including the Loop.

    Can someone please help, I really need to get this problem solved!

    Have you turned off all plugins?

    If it works in default and classic themes, it sounds like this is a theme conflict. Have you tried other themes?

    Finally, using something like pastebin, can you post your page template?

    No I haven’t turned off all the plugins because only the default ones are running.

    If I switch to either the classic or default themes, the Page content shows up on a Page just fine.

    However, using my theme (including page.php) a Page will load showing the most recent Post, not the Page content that I typed into the editor.

    I’ll try the pastebin site and see if I can’t paste the template here.

    Template Name: Web Page<br>
    <?php get_header(); ?>
    <div id="content">
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div id="page-<?php the_ID(); ?>"><br>
    <h1><?php the_title(); ?></h1><br>
    <?php the_content(‘Read the rest of this page &raquo;’); ?><br>
    <?php link_pages(‘Pages: ‘, ”, ‘number’); ?><br>
    <?php endwhile; endif; ?><br>
    <?php edit_post_link(‘Edit this entry.’, ”, ”); ?><br>
    <?php get_footer(); ?>

    Nevermind the “<br>” tags, they were added when I posted to this forum.

    I am having the exact same problem. I cant view any of my content pages, only posts.

    Anyone have any luck resolving this?

    If it happens only to your theme, may be you could zip it up and make it available for download so that someone could debug it with their wp installation.

    Download the theme for debugging.

    I was having the same problem, and just managed to fix it. It looks like you are doing the same thing I was. In your sidebar.php file, you are displaying a list of your most recent posts by calling $posts = get_posts(). The variable $posts is used by the WordPress loop, so using it here messes up the main loop.

    All I had to do to fix this problem was to rename this variable (I changed mine to $recent_posts). Hopefully this fixes your problem as well.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Page not showing “page content”, but most recent blog post’ is closed to new replies.