• Hi!

    I try to use dynamic sidebars for a different sidebar appearance on the main site/on category site.

    I registered 2 new sidebar, that appears in “Design” and there I can put widgets. My problem is now, how I can put the NEW sidebar into the category.php template of twenty eleven.

    For embedding I use this code:

    <ul id=”sidebar”>
    <?php dynamic_sidebar(6); ?>

    The sidebar appears, but at the bottom of the content (see https://www.jakli.at/category/food-experiences/)

    -> HOW CAN I BRING IT TO THE RIGHT SIDE ?

    Thanks for your help…

Viewing 2 replies - 1 through 2 (of 2 total)
  • the right sidebar file has to be named as sidebar-right.php and it needs to be included in index.php. u can use get_sidebar(‘right’) for including.

    two choices:

    A:
    in category.php, replace <?php get_sidebar(); ?> with (example) <?php get_sidebar('six'); ?>

    and put all the code for sidebar 6 into a file sidebar-six.php
    to have the same formatting as with the default sidebar, you would need to keep/copy the html structure of sidebar.php.

    B:
    in category.php, replace <?php get_sidebar(); ?> with the code for your sidebar 6; again, to keep the formatting/position of the sidebar, you will need to use the same html structure as in sidebar.php

    example:

    <div id="secondary" class="widget-area" role="complementary">
    <ul id="sidebar">
    <?php dynamic_sidebar(6); ?>
    </ul>
    </div>

    if an unordered list <ul id="sidebar"> structure is useful, depends on the way you have registered your sidebar 6 in functions.php

    https://codex.www.ads-software.com/Function_Reference/register_sidebar

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Dynamic Sidebar -> how to bring to the right side’ is closed to new replies.