• 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?

Viewing 4 replies - 1 through 4 (of 4 total)
  • I designed a new theme, in my page.php

    Maybe you should elaborate on the line above. A “theme” has minimum an index file and a style.css file. Otherwise is NOT a theme.
    page.php is ONE of the possible template files in a theme.

    Thread Starter annmolly

    (@annmolly)

    I designed a theme with index.php and style.css, one of my template file is page.php

    Ben L.

    (@nightgunner5)

    Well, if you have everything that would be needed in page.php in test.php, you would want to change

    <?php if ($page_name == "test") ?>
    <?php include (TEMPLATEPATH . '/test.php'); ?>

    to

    <?php if ($page_name == "test") include (TEMPLATEPATH . '/test.php'); exit; ?>

    Thread Starter annmolly

    (@annmolly)

    solved, i create new template using:
    <?php
    /*
    Template Name: xxx
    */
    ?>

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Unwanted Loop’ is closed to new replies.