Hello!
I was wondering if there was a way to hide the header and footer by default on portfolio pages, instead of having to select “hide the header on this page” and ” hide the footer” options every single time ?
Same question for the “blank template” for pages, is it possible to make it the default template?
Thanks a lot!
Hey!
Please add following code to Functions.php file in Appearance > Editor
add_action( 'after_setup_theme', 'enfold_customization_product_switch' );
function enfold_customization_product_switch(){
add_filter('avf_builder_elements', 'avf_builder_elements_mod');
}
function avf_builder_elements_mod($elements)
{
$counter = 0;
foreach($elements as $element)
{
if($element['id'] == 'footer') {
$elements[$counter]['std'] = 'nofooterarea';
}
if($element['id'] == 'header_transparency') {
$elements[$counter]['std'] = 'header_transparent header_hidden ';
}
$counter++;
}
return $elements;
}
Cheers!
Yigit
Wow, thanks a lot!
As I understand, this will apply to every page or post, is there a way to target 1 specific custom content type?
Hi!
Yes, new ones that you create will have these options by default. How would you like to limit it?
Best regards,
Yigit
Well for instance for it to apply only to portfolio items, and not pages.
Hey!
then add the specific conditional tag to the code, refer to: https://codex.wordpress.org/Conditional_Tags
Cheers!
Andy