[Resolved] PODs CPT – Sidebar

Home Forums Support [Resolved] PODs CPT – Sidebar

Home Forums Support PODs CPT – Sidebar

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #421158
    David
    Staff
    Customer Support

    Hi Tom,

    If i add a sidebar to the single blog post it also appears on the CPTs created in PODs.
    I notice the CPT’s carry the single class as do the posts and thought maybe i could target posts with this class that didnt have the single-post class..

    Any thoughts?

    regards

    David

    #421305
    Tom
    Lead Developer
    Lead Developer

    Single posts will inherit the Single post sidebar layout set in the Customizer.

    Are you wanting to disable the sidebar on this specific post type?

    #421398
    David
    Staff
    Customer Support

    Hi Tom

    Yes i have three CPTS that dont require it

    thanks

    David

    #421762
    Tom
    Lead Developer
    Lead Developer

    You could do this:

    add_filter( 'generate_sidebar_layout', 'tu_cpt_sidebar_layout' );
    function tu_cpt_sidebar_layout( $layout ) {
    
        if ( is_singular( 'post-type-name' ) ) {
            return 'no-sidebar';
        }
    
        return $layout;
    
     }
    #422550
    David
    Staff
    Customer Support

    Thank you Tom. Much appreciated.

    #422749
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.