Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #902895

    Hi,

    I want to create a masonry with WooCommerce products and posts. I know that it’s possible to select only products or only posts, but is it possible to combine them in one masonry?

    I want to create something like the masonry on this page: https://www.wonenmetlef.nl/nl/

    #904241

    Hey BuroStaal,

    Thank you for using Enfold.

    This is possible but you have to manually define the product category and post category ids inside a filter. Example:

    add_filter('avia_masonry_entries_query', 'avia_masonry_entries_query_mod', 10, 2);
    function avia_masonry_entries_query_mod($query, $params) {
      if( is_page( array( 296 ) ) ) {
    	$query['tax_query'] = array ( 
    		'relation' => 'OR',
    		array (
    			'taxonomy' => 'category',
    			'field' => 'id',
    			'terms' => array (20, 24, 21, 22, 23, 25, 1),
    			'operator' => 'IN',
    		)
    	);
    
    	$query['tax_query'][] = array(
    		'taxonomy' => 'product_cat',
    		'field' => 'term_taxonomy_id',
    		'terms' => array (15, 16, 17),
    		'operator' => 'IN'
    	);
      }
    
      return $query;
    }

    Replace the value of the is_page function with id of the page where the masonry element is located.

    Best regards,
    Ismael

    #904689

    Yeeaaahhhh it works! This is awesome, thanks Ismael!

    #905218

    Hi,

    Glad we could help!
    Please take a moment to review our theme and show your support https://themeforest.net/downloads
    To know more about enfold features please check – http://kriesi.at/documentation/enfold/
    Thank you for using Enfold :)

    Best regards,
    Basilis

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.