WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] 2.1: Individual posts and pages will not display, show blog content instead (8 posts)

  1. beoba
    Member
    Posted 7 years ago #

    Hi, I recently upgraded to WP2.1 from WP2.0.7. I've noticed a problem where static pages and individual posts will not display correctly. If I visit a url for a static page, WordPress returns the blog content, rather than the desired static content for that page.

    WordPress demonstrates that it knows what it SHOULD be displaying because the page title changes to the correct value, as does the background of the page (for example, if you visit a page under "Projects", the background correctly changes to purple).

    Example page (with correct purple background and page title): link
    Example individual post (again, notice how page title is correct, but the content isn't): link

    I am totally stumped, everything worked fine with 2.0.7, and I have not found any deprecated tags, nor am I using any custom SQL garbage. The entire template can be viewed here (the phps files are symlinks to the php files, click the phps'es).

    I'm guessing its something within my Loop, but I really have no idea. There isn't anything weird in there that I can see, and again everything was just dandy in 2.0.7. These two files contain the loop: index.php post.php

  2. beoba
    Member
    Posted 7 years ago #

    Oh, and to rule out any possible additional variables, the only plugin I'm using is Kismet.

  3. moshu
    Member
    Posted 7 years ago #

    Permalinks?
    Does it work if you set your permalinks to the default?

  4. Samuel B
    moderator
    Posted 7 years ago #

    It looks like something goofy in your permalinks. The link that's incorrect shows:
    http://beoba.net/200612/another-semester-nearly-completed/
    which looks like date is whacked.
    Another one:
    http://beoba.net/200701/under-100-a-practical-guide-to-buying-textbooks/
    Maybe I'm missing something. In fact - likely.

  5. beoba
    Member
    Posted 7 years ago #

    I don't think its a htaccess/mod_rewrite/permalink issue, as the HTML title of the page in both of those links is shown correctly. In other words, I'm pretty certain that WordPress knows what it's supposed to be displaying, as the non-content blocks are correct, but it regardless refuses to show the correct content.

    However, I'll try switching to default permalinks real fast to 1) check if htaccess is updated correctly, and 2) see if that somehow magically fixes things.

  6. beoba
    Member
    Posted 7 years ago #

    Yeah, that didn't do it.

    http://beoba.net/?page_id=198 - The title is "beoba.net >> Jabber File Sharing", yet it still doesn't load the correct content.

    I just now switched the theme to Default, and that made things work correctly, so its starting to look like its a theme issue. Once my upcoming class is over, I'll look at Default's code to figure out what my theme should be doing differently. I'll post here when I've (hopefully) figured out what it is.

  7. beoba
    Member
    Posted 7 years ago #

    Found it! Turns out I was wrong about the existence of custom queries. This code is from the sidebar (used to list recent articles) is apparently no longer usable. As soon as I commented it out, things worked:

    <? $temp_query = clone $wp_query; query_posts('showposts=5');
        while (have_posts()):
        the_post();
        echo '&nbsp;<a href="/#';the_id();echo '">';the_title();echo '</a>';
    endwhile;
    $wp_query = clone $temp_query; ?>

    Now to figure out how to replace this.. I got it from here, and remember not finding anything else that worked at the time. Has 2.1 added a tag that lets you do this, or is it forever broken?

  8. beoba
    Member
    Posted 7 years ago #

    Okay, I got it, no idea why this works, but it does:

    
      foreach(get_posts('showposts=5') as $post) {
        echo '&nbsp;<a href="/#'.$post->ID.'">';the_title();echo '</a>';
      }
    

    For a while I was having problems with get_posts somehow overriding the main content Loop. For some reason, when I put "get_posts" directly into the foreach like that, it keeps the main content Loop's data from being overridden.

    Thanks for your support!

Topic Closed

This topic has been closed to new replies.

About this Topic