The second coming of sidebar (4 posts)

  1. jgpippin
    Posted 11 years ago #

    Here's what I'd love to do, assuming a question I asked about child/parent page listings isn't answered brilliantly.

    I'd like to create a <i>second</i> sidebar, and a custom page template - identical to the default one - that will call said sidebar. This way, I can set on each page which sidebar I wish to have.

    How do I go about getting WP to recognize custom templates and call a second sidebar?

  2. jgpippin
    Posted 11 years ago #


  3. Avenir
    Posted 11 years ago #

    If you're talking about a template for a static page, then all you need to do is add:

    Template Name: blah

    to the top of the file you want to serve as the template for the new pages. And then when you're making a new page, select this new template from the drop-down box.

    To call a new sidebar, you can use the PHP include function. Make a new sidebar file, say example.php, and then add this where you want the code to be included:

    <?php include('example.php'); ?>

    If the file isn't in the same directory as example.php, make sure you use either the absolute path to example.php or the full web URL to it.

  4. jgpippin
    Posted 11 years ago #

    thank you. you, my friend, rule.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.