WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Additional Sidebars not matching 'look' of website (5 posts)

  1. jeffwithag
    Member
    Posted 4 years ago #

    Ok, first, I'm new to php and css, but I do have code experience, so can pick it up pretty quickly hopefully. I have been able to get a second sidebar, that will appear for a different page.

    I changed

    if ( function_exists( 'register_sidebars' ) ) {
    		register_sidebar();

    to

    if ( function_exists( 'register_sidebars' ) ) {
    		register_sidebars(2);

    in functions.php

    and created a copy of sidebar.php called sidebar-wow.php, changing it's id accordingly

    Finally, I changed

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

    to

    <?php
    if (is_page('wow')) {
    	include ('sidebar-wow.php');
    }
    	else{
    	include ('sidebar.php');
    	}
    ?>

    in my page.php.

    Now, this gives me the additional sidebar to add widgets too and what not. It also displays this new sidebar when I goto my wow page. However, the sidebar itself does not have the 'look' of my current theme. I'm assuming this is because sidebar-wow.php does not have the css applied to it? I've did some grepping, but am unsure where I'm suppose to reference my sidebar-wow to get the same look?

    To see what I'm talking about, visit jeffwithag.com and notice the sidebar differences between home(or geoff) page and the wow page. When I say differences I mean text coloring, font, centering, and not content. I want the content to be different, but I want the look and feel to be the same.

    Can anyone help?

    Thanks,
    Geoff

  2. alchymyth
    The Sweeper & Moderator
    Posted 4 years ago #

    instead of using <div id="sidebar-wow">
    use exactle the same as with the other sidebar, i.e.
    <div id="sidebar">
    and you will have the same formatting.

  3. jeffwithag
    Member
    Posted 4 years ago #

    wow, that was easy. Thank you so very much!

    Much appreciated!

  4. Mark / t31os
    Moderator
    Posted 4 years ago #

    As long as they never exist on the same page at once you'll be fine...

    IDs can only apply to 1 element on a page at any given time....

    If you need to reuse an element's CSS then you use a class...

    Just incase you should come into such problems later i felt it worth a mention... ;)

  5. jeffwithag
    Member
    Posted 4 years ago #

    k, thx ... I'll keep that in mind.

Topic Closed

This topic has been closed to new replies.

About this Topic