• I have a blog site using OceanWP. I want to remove the sidebar on the category pages, but I want to showcase the sidebar on my homepage, which is currently set to Recent Posts. Any idea how I can achieve this?

Viewing 1 replies (of 1 total)
  • Hello,

    Kindly add the below code to the child theme’s functions.php file to do it –

    function my_post_layout_class( $class ) {
    
    	if ( is_archive( 'post' ) ) {
    		$class = 'full-width';
    	}
    	return $class;
    
    }
    add_filter( 'ocean_post_layout_class', 'my_post_layout_class', 20 );
Viewing 1 replies (of 1 total)
  • The topic ‘Remove Sidebar from Category pages, but show on recent posts’ is closed to new replies.