Hello @jayceezay,
All the customizer settings in Astra can be filtered. Here is an example how you the value of Site Content Width can be changed using the filter.
add_filter(
'astra_get_option_site-content-width',
function( $width ) {
if ( has_category('block') ) {
$width = 900;
}
return $width;
}
);
In this change the slug block
to the slug of the category you want and change the value of $width
as per your needs.
You can change the if condition if customize this even further as you wish.
Hi @nikschavan ,
Thanks! Good to know that it can be done in Astra. I mainly just blog and am not a developer, but I roughly get what you wrote above. Could you let me know where I should paste and insert the code you provided?
Thanks again!
Hi @jayceezay,
A simplest way I would recommend is adding this code snippet using a WordPress plugin Code Snippets. This page also gives more information about how you can add snippets using this plugin.
Thank you @nikschavan! That worked out well for me. The 900 container $width in your example was what I used. If I may pose another question – How do I set the sidebar as a certain percentage of the 900 container $width? Thanks again!
Hey @jayceezay,
You can add below custom code to manage sidebar width.
add_filter( 'astra_get_option_site-sidebar-width',
function ( $width ) {
if ( has_category('block') ) {
// This width is in percentage.
$width = 20;
}
return $width;
}
);
Just modify number 20 here as per your requirement.
Please let me know if you have any further queries.
Regards,
Vikas
You’re most welcome, @jayceezay! 😊
If you need any further help. Please do let us know.
Regards,
Sweta