Forums

[resolved] Page Template Problem (4 posts)

  1. abovocipher
    Member
    Posted 4 months ago #

    Hello, I had a question about the templates for this theme. I know that you need to set a page to the template archive for the plugins to show up. I created 1 page to have the blogs on, but I would like to create a separate page that has a twitter feed on it. So I copied the archives.php page and made a archives2.php and changed the name of it to show up differently in the archives drop down list. I have also created a sidebar2.php that just has the secondary widgets in it and not the first box. The problem I run into is I don't know how to modify the:

    <?php get_sidebar() ?>

    in line 18 on the archives page to grab sidebar2.php instead of sidebar.php. If anyone could tell me how to define a new thing to get maybe like get_sidebar2 and define the element sidebar2=sidebar2.php. I tried looking in the functions page but couldn't find anything that defined that element. I am fairly new with .php and still learning.

    Any help would be much appreciated. Thanks,
    -jeff

  2. mercime
    Member
    Posted 4 months ago #

    Use
    <?php include(TEMPLATEPATH . "/sidebar2.php"); ?>

  3. abovocipher
    Member
    Posted 4 months ago #

    Sweet, that worked great. Thanks alot mercime

  4. MichaelH
    moderator
    Posted 4 months ago #

    Also note this that was available with 2.7

    get_sidebar('mysidebar') will include sidebar-mysidebar.php

Reply

You must log in to post.

About this Topic