Unwanted Loop
-
I designed a new theme, in my page.php, I want to redirect the page if the page name is test to test.php so I inserted
<?php if ($page_name == “test”) ?>
<?php include (TEMPLATEPATH . ‘/test.php’); ?><?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class=”details”>
<h2><?php the_title(); ?></h2>
<?php the_content(‘<p class=”serif”>Read the rest of this page »</p>’); ?><?php wp_link_pages(array(‘before’ => ‘<p>Pages: ‘, ‘after’ => ‘</p>’, ‘next_or_number’ => ‘number’)); ?>
<?php edit_post_link(‘Edit this entry.’, ‘<p align=”right”>’, ‘</p>’); ?>
</div><?php endwhile; endif; ?>
If function calls correctly to the test.php but displayed in all pages. Any suggestions?
The topic ‘Unwanted Loop’ is closed to new replies.