Forum Replies Created
-
AuthorPosts
-
I reply my self… /config-templatebuilder/avia-shortcodes/logoslider.php
But… can we override this file in the child theme? it is not working for me
Answer: https://kriesi.at/support/topic/is-it-possible-to-modify-files-in-enfold-child/#post-218226
- This reply was modified 7 years, 4 months ago by webvigo.
Victoria, any chance to do something similar with the related products in the single product view of woocommerce?
Thanks, it worked! I made the trick of using post_per_page to select the different attributes. I share my code for any other user:
add_action( 'pre_get_posts', 'pre_get_posts_featured', 10); function pre_get_posts_featured( $query ) { $vars = $query->query_vars; if($query->is_archive && $query->is_post_type_archive) { //var_dump($query); if( isset($vars['post_type']) && 'product' == $vars['post_type'] && $vars['posts_per_page'] >= '50') { if ($vars['posts_per_page'] == "50") { $attribute = "red"; } if ($vars['posts_per_page'] == "51") { $attribute = "blue"; } $taxquery = array( array( 'taxonomy' => 'pa_color', 'field' => 'slug', 'terms' => $attribute, 'compare' => '=' ) ); $query->set( 'tax_query', $taxquery ); } } return $query; }
Thanks, i will try to work on that.
Hello Victoria,
Yes let me provide you the demo page were i am working, thanks. I put the titles where i am using the directly shortcode of woocommerce that shows products by attributes and after, a block using the component of the theme “Products slider” that only allows us to show products by categories.
We are waiting for the php error fix in the woocommerce gallery, thanks for your work!
-
AuthorPosts