Title: Question on customized sidebar
Last modified: September 26, 2018

---

# Question on customized sidebar

 *  [conciseac](https://wordpress.org/support/users/conciseac/)
 * (@conciseac)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/question-on-customized-sidebar/)
 * 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](https://wordpress.org/support/users/conciseac/)
 * (@conciseac)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/question-on-customized-sidebar/#post-10724698)
 * 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”
 *  [Amit Singh](https://wordpress.org/support/users/apprimit/)
 * (@apprimit)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/question-on-customized-sidebar/#post-10725381)
 * 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.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/oceanwp/4.1.5/screenshot.png)
 * OceanWP
 * [Support Threads](https://wordpress.org/support/theme/oceanwp/)
 * [Active Topics](https://wordpress.org/support/theme/oceanwp/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/oceanwp/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/oceanwp/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Amit Singh](https://wordpress.org/support/users/apprimit/)
 * Last activity: [7 years, 7 months ago](https://wordpress.org/support/topic/question-on-customized-sidebar/#post-10725381)
 * Status: not resolved