WordPress.org

Support

Support » Themes and Templates » The second coming of sidebar

The second coming of sidebar

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • anybody?

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

    <?php
    /*
    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.

    thank you. you, my friend, rule.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘The second coming of sidebar’ is closed to new replies.
Skip to toolbar