What is the right order for include tags?
-
Hi. I’m editing a theme and I don’t know why WordPress changes content depending on the order INCLUDE statements.
If I have this code in page.php:
<?php get_header(); ?> <div id="content_box"> <div id="left_box"> <?php include (TEMPLATEPATH . '/left_bar.php'); ?> </div> <div id="content" class="page"> <div id="content_inner"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <h1><?php the_title(); ?></h1> <div class="format_text"> <?php the_content('<p>Read the rest of this page →</p>'); ?> <?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?> </div> </div> <?php endwhile; endif; ?> </div> </div> <?php get_footer(); ?>
I do not get the contents of the page! Instead I get the same content as the index.
If I reverse the order and have include (TEMPLATEPATH . ‘/left_bar.php’); after the post loop, it works but that breaks my CSS.
Is there a certain order I must respect in order to get the page loop to work?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘What is the right order for include tags?’ is closed to new replies.