Custom sidebar on custom post type

Hi there,

I have been trying to add a custom sidebar (id='ups-sidebar-bulletin-board) to my custom post type ‘bulletin_board’ - which uses the standard wp single post template with sidebar - but something does not seem to be working.

I added this code to the child theme functions.php file

// ADD SIDEBAR TO CUSTOM POSTS
// =============================================================================

function add_sidebar_custom_post() {
if( get_post_type() == ‘bulletin_board’) {
return ‘ups-sidebar-bulletin-board’;
}
}
add_filter( ‘ups_sidebar’, ‘add_sidebar_custom_post’ );

It does make my custom sidebar show up on my CPT, but it makes the main sidebar disappear from my standard posts.

Am i missing something?

Thanks,
Sophie

Hi There,

Would you mind providing us with login credentials(by clicking on the Secure Note button at the bottom) so we can take a closer look? To do this, you can make a post with the following info:

  • Link to your site
  • WordPress Admin username / password

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.