Altering Layouts (No Sidebar, Left or Right Sidebar)
This is a Developer Level doc.
If you're unfamiliar with PHP and/or editing files, codes and templates, as well as with resolving possible conflict, please seek help from a professional. Under our Support Policy, we don't provide support for modifications and customization.
/**
* Alter your post layouts
*
* Replace is_singular( 'post' ) by the function where you want to alter the layout
* You can also use is_page ( 'page name' ) to alter layouts on specific pages
* @return full-width, full-screen, left-sidebar, right-sidebar or both-sidebars
*
*/
function my_post_layout_class( $class ) {
// Alter your layout
if ( is_singular( 'post' ) ) {
$class = 'full-width';
}
// Return correct class
return $class;
}
add_filter( 'ocean_post_layout_class', 'my_post_layout_class', 20 );
Adjust the is_singular( 'post' ) and $class values per your need.
All PHP snippets should be added via a child theme's functions.php file.