Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #640608

    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

    #641158

    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

    #641322

    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?

    #642348

    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

    #642469

    this is working perfectly! Thank you very much!!

    HEIOO.

    is this possible for the tags too?

    if is_tag() isn´t working

    • This reply was modified 8 years, 6 months ago by Raphael.
    #642472

    Hi,

    Glad to hear that it worked!

    Best regards,
    Jordan

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Change layout and columns and sidebars in products’ is closed to new replies.