WordPress.org

Ready to get started?Download WordPress

Forums

Double sidebar (14 posts)

  1. wessel242
    Member
    Posted 7 years ago #

    Hi...I'm trying to create a custom sidebar for a new installation of WP 2.2. I created a template.php page and copied the sidebar.php and called it sidebar.php. In the template.php page I call the modified sidebar like this...

    include @ ("sidebar2.php");

    but the original sidebar and sidebar2.php both show at the same time. I've been struggling because I have a feeling the fix is easy. Any advice to a n00b?

  2. jugularbean
    Member
    Posted 7 years ago #

    Could you post the basic structure of your template.php page?

  3. moshu
    Member
    Posted 7 years ago #

    If it's long, don't post it here!
    Use http://wordpress.pastebin.ca

  4. wessel242
    Member
    Posted 7 years ago #

    OK, template.php has been posted...Thanks!

  5. moshu
    Member
    Posted 7 years ago #

    ;) - then, please, post back with the address...

  6. jugularbean
    Member
    Posted 7 years ago #

    hmmm...could you link to the site please?

  7. moshu
    Member
    Posted 7 years ago #

    But without looking at it: you don't need the @ in your code!

  8. wessel242
    Member
    Posted 7 years ago #

    http://wordpress.pastebin.ca/509403

    Sorry link didn't go through the first time.

  9. wessel242
    Member
    Posted 7 years ago #

    Does it with and without the @

  10. moshu
    Member
    Posted 7 years ago #

    If the files are in the theme directory, try this:
    <?php include (TEMPLATEPATH . '/sidebar2.php'); ?>

  11. moshu
    Member
    Posted 7 years ago #

    Oh, and check your footer.php - many themes call the (original) sidebar from there.

  12. wessel242
    Member
    Posted 7 years ago #

    Sorry moshu, no luck with

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

    and nothing in the footer.php

  13. jugularbean
    Member
    Posted 7 years ago #

    are you sure you selected page template as Home Page Template for the page on which you want this template to work?

  14. wessel242
    Member
    Posted 7 years ago #

    Thanks Moshu...found a call to the sidebar from the header.php as you indicated.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags