• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Code from Carrie Dils (2015 post) to call custom sidebar for specified category

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Code from Carrie Dils (2015 post) to call custom sidebar for specified category

This topic is: resolved

Tagged: Genesis Simple Sidebars, Outreach Pro

  • This topic has 3 replies, 2 voices, and was last updated 8 years ago by wildwebwest.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • November 1, 2017 at 8:21 pm #213162
    wildwebwest
    Member

    Hi Genesis Fans:

    I'm upgrading a municipal site to a mobile responsive theme - using outreach-pro.

    Here's my question... the staging site is at idahocounty.com

    Way back in 2010, I started this client on using posts for minutes and agendas to organize things easily so there are currently 7 years of posts.

    [Unless you know of an easier way to bulk update lots of single posts so that they reflect the appropriate left sidebar for the category the post belongs to...]

    I would like to be able to setup some custom code in the functions.php file so that no one has to go in and update every single post so that it reflects the specific left custom sidebar that fits with the specific category. It would happen automatically in the single posts. The right primary sidebar always uses the default so no need to deal with that one.

    Does this code from Carrie Dils still work in modern Genesis framework (many upgrades since the help blog was posted)? Obviously I would edit to match the categories that I've setup. I just want to avoid opening every single post to assign a custom left sidebar and hope this code might do the trick for the various categories (mostly minutes and agendas).

    I am using Genesis Simple Sidebars - one of my faves - to create multiple sidebars as we web developers always want to accommodate the clients preferences, of course!

    Here's the code:

    ---------------------

    add_action('get_header','cd_change_genesis_sidebar');
    function cd_change_genesis_sidebar() {
    if ( is_singular('jobs')) { // Check if we're on a single post for my CPT called "jobs"
    remove_action( 'genesis_sidebar', 'genesis_do_sidebar' ); //remove the default genesis sidebar
    add_action( 'genesis_sidebar', 'cd_do_sidebar' ); //add an action hook to call the function for my custom sidebar
    }
    }

    //Function to output my custom sidebar
    function cd_do_sidebar() {
    dynamic_sidebar( 'job-single-sidebar' );
    }

    -------------
    Thanks for any advice. I'm not a real strong coder but I've been muddling through over the years by finding sharp people like Carrie who make things easy.


    Wild Web West, LLC
    #IHeartGenesis

    November 3, 2017 at 7:15 am #213215
    Victor Font
    Moderator

    It looks like it should still work. Did you try it or ask Carrie?


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    November 5, 2017 at 6:50 pm #213301
    wildwebwest
    Member

    Hi Victor. Thank you for your reply.

    No, I didn't ask Carrie. I was kind of looking for concrete answers from experts like you from end of 2017 since this code was created almost 2.5 years ago. So much has changed. I'll go for it and will leave this open until I test it out.

    I may still need help (I'm a weak coder) because I'm using Genesis Simple Sidebars to build custom left sidebars which throws an extra wrench in the spokes in terms of challenges. I'll leave this open and if I need help or I am successful, I'll post back.

    Thanks again Victor.


    Wild Web West, LLC
    #IHeartGenesis

    November 10, 2017 at 11:00 pm #213472
    wildwebwest
    Member

    We can close this ticket. Its just too complicated for me and no time to waste.


    Wild Web West, LLC
    #IHeartGenesis

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Code from Carrie Dils (2015 post) to call custom sidebar for specified category’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble