Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author oceanwp

    (@oceanwp)

    Hello, you need to call your custom sidebar for your single post: https://docs.oceanwp.org/article/267-alter-the-main-sidebar-display

    Replace “gallery” by “post”, and “my_custom_sidebar_id” by your sidebar ID.

    Thread Starter LogoLogics

    (@logologics)

    Hello Nic,

    I put this in the “snippets” plugin because I do not use a childtheme.
    I suppose snippets is ok too?

    function my_custom_sidebar_display( $sidebar ) {
    	// Return a different sidebar for custom post type 'post'
    	if ( is_singular( 'post' ) ) {
    		return 'my_custom_sidebar_ocs-blog';
    	}
    	// Return theme defined sidebar area
    	else {
    		return $sidebar;
    	}
    }
    add_filter( 'ocean_get_sidebar', 'my_custom_sidebar_display' );

    Still not working though….

    Thanks,
    Annie

    Thread Starter LogoLogics

    (@logologics)

    You can ignore the above!

    Replaced:

    return 'my_custom_sidebar_ocs-blog';

    with: return 'ocs-blog';

    and now it works, thanks!

    Plugin Author oceanwp

    (@oceanwp)

    Yes, you need to change by your sidebar ID ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Sidebar does not show the widgets’ is closed to new replies.