Hi @fznshaikh,
There’s no dedicated option for a CPT at the moment. It will inherit the global container layout on the Customizer. Or you can set it individually through Page Specific Astra Settings.
I hope that will help.
Kind regards,
Herman 🙂
There should be code snippet, right?
Hi @fznshaikh,
I don’t think you will need it. You can just configure it through the global container layout and the CPT layout will inherit it. Or use Page Specific Astra Settings to set a CPT layout individually.
I hope it helps.
Kind regards,
Herman 🙂
I actually need it because I don’t want to individually modify every CPT(there are multiple). And if I use global option, then unexpected then I have to do it manually for posts which I don’t want to have a global settings.
I’m sure there should be a snippet. If you provide an example, I’ll take care of my requirements. On the Astra facebook group someone else needed the same so he said to contact support so I’m sure there’s a snippet which will save time.
Hi @fznshaikh,
Would you please try adding this custom PHP code to your site
add_filter( 'astra_get_content_layout', 'custom_post_type_content_layout');
// Update the container layout based on Custom Post Type.
function custom_post_type_content_layout ( $layout ){
// Add your CPT instead of newspaper, book. If it's only for one CPT then add just one CPT.
if ( is_singular( array( 'newspaper', 'book' ) ) ) {
$layout = 'boxed-container'; // This is Boxed layout
}
return $layout;
}
Please refer to this doc to know how to add custom PHP code in Astra.
And please refer to below for the Layout:
- Full Width / Streched = “page-builderpage-builder”
- Full Width / Contained = “plain-container”
- Content Boxed = “content-boxed-container”
- Boxed = “boxed-container”
I hope that will help.
Kind regards,
Herman 🙂