• Hi, you kindly answered my question and had it resolved but I have a follow up pls!

    Regarding customizing the sidebar per catgory, I couldn’t get it to work.

    Is it because I am using your other plugin called “Ocean Custom Sidebar”?

    So, just to confirm again, I created a “Custom Sidebar” called: ‘ocs-tester-sidebarx’

    The category I would like to display that on is titled ‘Alaska’ – slug would be ‘alaska’

    I made the changes as per below but no joy…

    ++++ START

    function my_custom_sidebar_display( $sidebar ) {
    // Return a different sidebar for custom post type ‘gallery’
    if ( is_singular( ‘alaska’ ) ) {
    return ‘ocs-tester-sidebarx’;
    }
    // Return theme defined sidebar area
    else {
    return $sidebar;
    }
    }
    add_filter( ‘ocean_get_sidebar’, ‘my_custom_sidebar_display’ );

    +++++ End

    Am I doing something wrong here? I tried different variations…

    Is it because my custom post type is created by WordPress PODS Framework?

    I was hoping the custom sidebar would load on the official WordPress category…

    Thanks for all advice/ help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter conciseac

    (@conciseac)

    OK FIXED IT (I think?!)

    So this works:

    function my_custom_sidebar_display( $sidebar ) {
    // Return a different sidebar for custom post type ‘gallery’
    if ( in_category( ‘Alaska’ ) ) {
    return ‘ocs-tester-sidebarx’;
    }
    // Return theme defined sidebar area
    else {
    return $sidebar;
    }
    }
    add_filter( ‘ocean_get_sidebar’, ‘my_custom_sidebar_display’ );

    *** The difference being the IN CATEGORY – that’s where I had the “issue”

    Glad to hear that you resolved the issue!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Question on customized sidebar’ is closed to new replies.