Need Color Switcher on Navbar similar to "Studio Press Shop for Themes" demos

Community Forums Forums General Discussion Need Color Switcher on Navbar similar to "Studio Press Shop for Themes" demos

This topic is: resolved

This topic contains 3 replies, has 2 voices, and was last updated by  PresterJohn 2 months, 4 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #86563

    PresterJohn
    Participant
    Post count: 57

    Is there a plugin or code I can use to install a theme color switcher similar to what is used on the sample themes on the “Studio Press Shop for Themes” page?

    I want the client to be able to switch theme colors by picking the color option on the primary nav bar.

    I looked at the source code and see how the menu is constructed. Can’t find a plugin that does this however. I’m thinking it must be some code in functions.php but see nothing listed in the code samples.

    • This topic was modified 3 months ago by  PresterJohn.
    • This topic was modified 3 months ago by  PresterJohn.
    #86742

    nutsandbolts
    Moderator
    Post count: 2619

    Here is a recent post about that topic from Carrie Dils: http://www.carriedils.com/body-class-querystring/


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I do Genesis tutorials, design and development, and other fun stuff • Find me on Twitter and Google+

    #86907

    PresterJohn
    Participant
    Post count: 57

    Hi Andrea, I followed the instructions but I must be missing something. Here is what I did:

    //*Add color switcher to menu bar
    add_filter('body_class', 'string_body_class');
    function string_body_class( $classes ) {
    if ( isset( $_GET['color'] ) ) :
    $classes[] = 'outreach-pro-blue' . sanitize_html_class( $_GET['color'] );
    $classes[] = 'outreach-pro-green' . sanitize_html_class( $_GET['color'] );
    $classes[] = 'outreach-pro-purple' . sanitize_html_class( $_GET['color'] );
    $classes[] = 'outreach-pro-orange' . sanitize_html_class( $_GET['color'] );
    $classes[] = 'outreach-pro-red' . sanitize_html_class( $_GET['color'] );
    endif;
     
    return $classes;
    }

    Can you see anything I might have done wrong?

    #86908

    PresterJohn
    Participant
    Post count: 57

    Figured it out Andrea. Copied the code wrong.

    Thank you too for pointing me to the page. Much appreciated!

    • This reply was modified 2 months, 4 weeks ago by  PresterJohn.
    • This reply was modified 2 months, 4 weeks ago by  PresterJohn.
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.