Snippets: Altering Layouts (Full Screen, No Sidebar, Left Sidebar, Right Sidebar)

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

	// Alter your custom post type layout
	if ( is_singular( 'YOUR_CPT' ) ) {
		$class = 'full-width';
	}

	// Return correct class
	return $class;

}
add_filter( 'wpex_post_layout_class', 'my_post_layout_class', 20 );

Snippet Type: PHP

Posted Under: Core

All PHP snippets should be added via a child theme's functions.php file.