• 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

Custom sidebar per page?

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 › General Discussion › Custom sidebar per page?

This topic is: resolved

Tagged: blog, custom sidebar, posts

  • This topic has 8 replies, 3 voices, and was last updated 8 years, 5 months ago by jmamuzich.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • May 17, 2014 at 5:55 pm #105668
    bionary
    Member

    Ok, so I want to scream after spending the last 2 days trying out so many plugins that promise customization for sidebars.

    I would like to have different sidebars for some page.For instance: most all pages should have "latest posts" and "categories" widgets but I would like my blog page, any posts, or any date page (http://mysite.com/2014) to have the "calendar", "search", and "tags" widget.

    So far I have tried plugins:
    custom sidebars 1.5
    Genesis Simple Sidebars 2.0.1
    Per Page Sidebars 2.0
    Widget Logic 0.57

    To my chagrin, non of these work with my genesis/beautiful theme. They either don't work at all or throw all kinds of errors when using them, which makes them unstable and not an option for production code I'm afraid. (Honestly this was my wp experience 6 years ago and the reason I stayed away... I spent more time hacking away at stuff trying to get it to work)

    Does anyone have advice for customizing sidebar widgets for specific pages. I'm open to: a) plugins that actually work, b)some kind of php function/template solution.

    Thanks.

    May 17, 2014 at 7:51 pm #105674
    nutsandbolts
    Member

    Can you talk a little more about what happened with the Genesis Simple Sidebars plugin? I have used that on dozens of sites and at least 3-4 of them are using Beautiful Pro. I use it on my own sites as well.


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

    May 17, 2014 at 9:06 pm #105686
    bionary
    Member

    Sure,

    The genesis simple sidebars plugin, worked for some pages and not others and when clicking on update (setting it up) it always threw back a pile of php errors. I inquired about it via the paid members support and I got this response:

    "We are aware of the issue and we are working on a fix."

    May 17, 2014 at 9:07 pm #105688
    nutsandbolts
    Member

    Hmm, that's very interesting and something I haven't come across - will have to go back to a few client sites and make sure it's still working for them. Thanks for the details!

    There are some manual ways to add different sidebars to your site. Here's a great tutorial (it's for custom post types but can work with any conditional): http://www.carriedils.com/sidebar-custom-post-type/


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

    May 22, 2014 at 7:45 pm #106430
    bionary
    Member

    @nutsandbolts

    So I triedd out that link you mentioned above. It works great but fails under one circumstance (which is of course how I need to use it) let me explain....
    first the code:

    
    // Register new sidebar
    genesis_register_sidebar( array(
    	'id' => 'job-single-sidebar',
    	'name' => 'Single Job Sidebar',
    	'description' => 'This is the sidebar for single job pages[ this was added via functions.php ].',
    ) );
    add_action('get_header','cd_change_genesis_sidebar');
    function cd_change_genesis_sidebar() {
        if ( is_page('blog') ) {
            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' );
    }

    It removes replaces the default sidebar except on the page that is designated as the blog if choosen in settings.
    So I had Settings>Reading>front page displays set to Post Page:blog .... and it won't do the sidebar swap on that page. ... I did several tests with other pages/configurations and for some reason the swap will not happen on the designated "front page display"

    May 22, 2014 at 9:51 pm #106437
    nutsandbolts
    Member

    Instead of using

    if ( is_page('blog') ) {

    try using

    if ( is_home() ) {

    I know that seems odd if the blog page isn't the homepage, but "home" in this case refers to the page that displays the list of most recent posts.


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

    October 20, 2014 at 10:39 am #128447
    jmamuzich
    Member

    Hi Nuts and Bolts,

    I was wondering what the snippet of code for this would be to register it on the blog and single posts?

    Thanks in advance,

    Jaclyn

    October 20, 2014 at 10:42 am #128448
    nutsandbolts
    Member

    Hi Jaclyn,

    Try using if ( is_home() || is_single() ) { - that should display on the blog archives and on single posts.


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

    October 20, 2014 at 10:45 am #128449
    jmamuzich
    Member

    Worked perfectly. Thank you SO MUCH! I couldn't remember how to write it out for more than one 😉

    You're a lifesaver!

    - Jaclyn

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Custom sidebar per page?’ 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

© 2023 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