• Resolved jsj90

    (@jsj90)


    Hi,

    Previously I asked about allowing CPT to inherit the Homepage settings such as No Title, No Meta and No related post. It works.

    Now, how do I make it automatically 100% Full Width without going to each page and change it from OceanWP Settings?

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Theme Author oceanwp

    (@oceanwp)

    Hello, look at this article of the documentation: https://docs.oceanwp.org/article/203-altering-layouts

    Replace “full-width” by “full-screen”.

    Thread Starter jsj90

    (@jsj90)

    Hi,

    I followed the article and the instruction given. But my CPT page is still showing sidebar.

    /**
    * Alter your post layouts
    *
    * @return full-width, full-screen, left-sidebar or right-sidebar
    *
    */
    function my_post_layout_class( $class ) {

    // Alter your layout
    if ( is_singular( ‘post’ ) ) {
    $class = ‘full-screen’;
    }

    // Return correct class
    return $class;

    }
    add_filter( ‘ocean_post_layout_class’, ‘my_post_layout_class’, 20 );

    Thank you.

    Theme Author oceanwp

    (@oceanwp)

    This is normal, you need to replace “post” by the name of your CPT ??
    I will notify it in the article to be clearer.

    Thread Starter jsj90

    (@jsj90)

    Hi,

    Thanks. Meaning I need to include the slug? If I have 3 CPT, how should I input it?
    Sorry for all the weird questions :/

    Theme Author oceanwp

    (@oceanwp)

    No problem ??
    If I have three CPT, the slug are: “post-type1”, “post-type2” and “post-type3”.
    My function will be like this:

    function my_post_layout_class( $class ) {
    
    	if ( is_singular( 'post-type1' ) || is_singular( 'post-type2' ) || is_singular( 'post-type3' ) ) {
    		$class = 'full-screen';
    	}
    
    	return $class;
    
    }
    add_filter( 'ocean_post_layout_class', 'my_post_layout_class', 20 );
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘CPT Page to have 100% Full Width’ is closed to new replies.