• Resolved beoba

    (@beoba)


    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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter beoba

    (@beoba)

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

    moshu

    (@moshu)

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

    Samuel B

    (@samboll)

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

    Thread Starter beoba

    (@beoba)

    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.

    Thread Starter beoba

    (@beoba)

    Yeah, that didn’t do it.

    https://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.

    Thread Starter beoba

    (@beoba)

    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?

    Thread Starter beoba

    (@beoba)

    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!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘2.1: Individual posts and pages will not display, show blog content instead’ is closed to new replies.