为内页添加第二个侧边栏

I am customizing this Wordpress theme and I want it to have a similar 3-column homepage look as http://www.marieclaire.com/ especially the inner sidebar custom image title.

The theme I am using uses the same sidebar for all the pages and its not working with the custom image title, as it also appears on all pages. I want to add a second sidebar that only appears on all other pages except homepage.

I contacted the theme developer but they have not responded in 2 weeks and I am running against a set deadline. I need your help writing the code.

        <div class="primary-sidebar">
        <?php if( is_active_sidebar( 'sidebar-primary' ) ): ?>
            <?php dynamic_sidebar( 'sidebar-primary' ); ?>
        <?php endif; ?>
        </div>

        <?php
        $layout = get_theme_options_data( 'presto_website_layout' );
        if( ($layout != "layout-2") && ($layout != "layout-1") ):
        ?>
            <div class="secondary-sidebar">
            <?php if( is_active_sidebar( 'sidebar-secondary' ) ): ?>
                <?php dynamic_sidebar( 'sidebar-secondary' ); ?>
            <?php endif; ?>
            </div>
        <?php endif; ?>

    </div><!-- .site-main-wrap -->
</div>

Thank you for your help.

Is this second sidebar something that is static, or something that you want to be able to add widgets to from the "Widgets" page?

If the first, just create a separate page template for your inside pages and put your static sidebar in it.

If the second, you'll want to do the following:

  1. Register a custom sidebar
  2. Create a custom page template for your inside pages
  3. Call the custom sidebar from your custom page template.

Here's a step-by-step guide for doing it: http://www.paulund.co.uk/how-to-register-a-sidebar-in-wordpress