Forums

Multiple templates in one blog? (5 posts)

  1. igaryok
    Member
    Posted 8 months ago #

    I just created 2 completely unrelated Amazon astores for example purposes. So let's say I want one tab to be Electronics, and the other to be Cosmetics.

    Basically what I need to do is create a separate template for each store/tab. So..... One would be

    <?php
    /*
    Template Name: Cosmetics
    */
    ?>
    <?php get_header(); ?>
    <iframe src="http://astore.amazon.com/cosmetics-20" width="80%" height="800" frameborder="0" scrolling="no"></iframe>
    <?php get_footer(); ?>

    And the other would be

    <?php
    /*
    Template Name: Electronics
    */
    ?>
    <?php get_header(); ?>
    <iframe src="http://astore.amazon.com/electronics-20" width="80%" height="800" frameborder="0" scrolling="no"></iframe>
    <?php get_footer(); ?>

    Everything seems to work fine when only one template is applied, however, whenever I try to use the second template nothing seems to happen? Is there some sort of a trick to make this work, or does Wordpress simply not support this?

    I searched for an answer, but couldn't find anybody having a similar issue.

  2. igaryok
    Member
    Posted 8 months ago #

    bump

  3. repomonkey
    Member
    Posted 4 months ago #

    Would be interested in knowing if you resolved this as we'd like to do exactly the same thing.

  4. Xamataca
    Member
    Posted 4 months ago #

    Templates are assigned to pages, categories or post. So, you can use conditional tags to get the template needed:

    <?php if ( is_category(X) ) {
    	include(TEMPLATEPATH . '/template_1.php');
    }

    Or if it is a page

    <?php if ( is_page(X) ) {
    	include(TEMPLATEPATH . '/template_2.php');
    }
  5. kichu
    Member
    Posted 4 months ago #

    Include the template in which file?

    S.K

Reply

You must log in to post.

About this Topic

Tags