Two Sections on Woocommerce Catergory Page [closed]

You have copy the archive-product.php in your template folder in the woocomerce folder. Then you edit the file and basically run a loop trough the catgeories you want (for example you category id’s are 12 and 24); $product_categories = array(12,24); foreach($product_categories as $category){ $product_options = array( ‘posts_per_page’ => -1, ‘post_type’ => ‘product’, ‘orderby’ => ‘menu_order’, … Read more

Remove any product that is featured from regular display loop [WooCommerce]

Use the pre_get_posts filter to remove your sticked product from the product loop. add_action( ‘pre_get_posts’, ‘exclude_stycky_product’ ); function exclude_sticky_product(){ // target only the main query if ( ! is_admin() && $query->is_main_query() ) { $query->set(‘ignore_sticky_posts’); $query->set(‘meta_value’, ‘1’); } } Hope it helps you !

set terms to category and subcategory

I figured it out first set the terms to post through wp_set_object_terms and then run a update query in term_taxonomy table and set parent id of the the second term to first term. $taxo = wp_set_object_terms( $news_arr[0], utf8_encode($news_arr[2]), ‘vehicle_models’, $append = false ) ; $child = wp_set_object_terms( $news_arr[0], utf8_encode($news_arr[3]), ‘vehicle_models’, $append = true ) ; … Read more