Last active
April 19, 2019 03:30
-
-
Save blogjunkie/5067805934a3f817f27c953be0a5d290 to your computer and use it in GitHub Desktop.
Force a page layout for post type in Astra theme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'astra_get_content_layout', 'child_astra_post_type_content_layout'); | |
/** | |
* Force the container layout for post type in Astra theme | |
*/ | |
function child_astra_post_type_content_layout ( $layout ){ | |
// Apply only to specific post types | |
if ( is_singular( array( 'fl-builder-template' ) ) ) { | |
// Define the layout. Valid values: | |
// page-builder (Full Width / Stretched) | |
// plain-container (Full Width / Contained) | |
// content-boxed-container (Content Boxed) | |
// boxed-container (Boxed) | |
// default (Customizer setting) | |
$layout = 'page-builder'; | |
} | |
return $layout; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment