WordPress.org

Ready to get started?Download WordPress

Forums

Page.php broken after upgrade to 2.1 (6 posts)

  1. muesliq
    Member
    Posted 7 years ago #

    I have upgraded from 2.0.4 to 2.1.2 recently, now my "Pages" are broken. They show the correct <title>, yet the blog index instead of their content. See my site at http://www.helge.at.

    Following Lorelle's post I have searched all my theme files and found NO occurrencies of depricated templates, except these ones that don't seem to make problems:

    - list_cats: continues to display nicely. no problems whatsoever visible.
    - link_pages: in page.php. I have removed that, what it did wasn't necessary anyway.
    - next_post and previous_post: continue to display nicely. no problems whatsoever visible.

    Nevertheless all my static pages are still broken.

    Ideas anybody?

  2. muesliq
    Member
    Posted 7 years ago #

    Since the page code is quite short I figured it might be helpful to post it here

    <?php
    get_header();
    ?>
    <?php get_sidebar(); ?>
    
    <!--Start CONTENT -->
    <div class="content">
    <!--Start Maincontent -->
    <div class="maincontent">
    
        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div class="posttitle"><h1 class="page"><?php the_title(); ?></h1></div>
    		<div class="contentwrap">
    				<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
    				<!-- ?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ? -->
    
    	  <?php endwhile; endif; ?>
    	<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
    
    		</div>
    
    <?php comments_template(); // Get wp-comments.php template ?>
    
    </div>
    <!--End Maincontent -->
    <div class="contentfooter"><img src="<?php bloginfo('template_url'); ?>/images/main/footercorner.gif" alt="corner" style="display:block; float:left;"/></div>
    
    <?php get_footer(); ?>

    An example for such a page, not displaying proper content is: http://www.helge.at/contact/ (note the correct tab and <title>, yet incorrect main content)

  3. muesliq
    Member
    Posted 7 years ago #

    I now tried to use the php-code from SVN (page.php, content-div) - same problem. Blog index instead of page content.. Help!!

    As it might have to do with the database here go the rows in question.

  4. rudolf45
    Member
    Posted 7 years ago #

  5. muesliq
    Member
    Posted 7 years ago #

    Hi rudolf, I have read that post before and cannot find how it applies to the code above.

    I just don't understand how and why the_post() and the_content suddenly print out the loop of blog posts instead of the content of that very page..

    Also as in the default 2.1-template it works that very same way I don't understand why it doesn't in my case.

    Could somebody knowledgeable have a look at my database please? Maybe the problem is there..

  6. muesliq
    Member
    Posted 7 years ago #

    Update: I somehow found out that the problem disappears if I remove <?php get_sidebar(); ?> from the template (or move it from above to below the main content).

    Why? I still don't know. At least I know now that page.php and database are both fine.

    Will try to find out what's wrong with the sidebar (and why only for pages).

Topic Closed

This topic has been closed to new replies.

About this Topic