Skip to content

Instantly share code, notes, and snippets.

@blogjunkie
Last active April 19, 2019 03:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blogjunkie/5067805934a3f817f27c953be0a5d290 to your computer and use it in GitHub Desktop.
Save blogjunkie/5067805934a3f817f27c953be0a5d290 to your computer and use it in GitHub Desktop.
Force a page layout for post type in Astra theme
<?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