Hi there,
i need to make different views of sidebars and grids and everything i tried wasn´t working.
I tried around with this snippet:
add_filter('avia_layout_filter', 'avia_change_post_layout', 10, 2);
function avia_change_post_layout($layout, $post_id) {
if( is_archive() )
{
$layout['current'] = $layout["fullsize"];
$layout['current']['main'] = "fullsize";
}
return $layout;
}
but i needed it for specific id´s with or without the full layout. And if it´s posssible with different colums if it is “fullsize”.
Can you help me with the PHP.
Thank you
Hey Rafíyel!
Thank you for using Enfold.
What do you mean by “products”? Is this a single product or the product overview page? Could you please provide a screenshot of the layout that you have in mind? Note that you can use the advance layout builder for the product.
Regards,
Ismael
it is for the archive view. (overview page)
For 1 archive page i have the sidebar. Fo the others i need to hide the sidebar and make the layout fullsize.
I tried around with the function above but it didn´t work for me
I tried if( is_category(’54’) ) // if( is_term(’54’) ) … nothing worked?
Hi,
Use the is_tax function. Example:
add_filter('avia_layout_filter', 'avia_layout_filter_mod', 10, 2);
function avia_layout_filter_mod($layout, $post_id) {
if( is_tax( 'product_cat', array(28, 3, 5) ) )
{
$layout['current'] = $layout["fullsize"];
$layout['current']['main'] = "fullsize";
}
return $layout;
}
The “array(28, 3, 5)” part is the id of the product categories.
Best regards,
Ismael
this is working perfectly! Thank you very much!!
HEIOO.
is this possible for the tags too?
if is_tag() isn´t working
Hi,
Glad to hear that it worked!
Best regards,
Jordan