Skip to content
Code snippets and stuff
  • Home
  • WordPress
  • Woocommerce
Toggle the button to expand or collapse the Menu
  • Home
  • WordPress
  • Woocommerce

Author: wp_admin

This author has written 16 articles
  1. Home>
  2. wp_admin>
  3. Page 3

Category query for multiple categories

  • Post author:wp_admin
  • Post published:March 21, 2023
  • Post category:Woocommerce

function add_all_fruits_to_category($query) { $catnames = $query->get('category_name'); if ($catnames == 'fruits') { $query->set('category_name', $catnames . ',bananas,apples,pears'); } } add_action('pre_get_posts', 'add_all_fruits_to_category');

Continue ReadingCategory query for multiple categories

Exclude products from a particular category on the shop page

  • Post author:wp_admin
  • Post published:March 17, 2023
  • Post category:Woocommerce

/*** Exclude products from a particular category on the shop page****/ function custom_pre_get_posts_query( $q ) { if (( !is_admin() && is_main_query()) OR is_search()) { $tax_query = (array) $q->get( 'tax_query' );…

Continue ReadingExclude products from a particular category on the shop page
  • Go to the previous page
  • 1
  • 2
  • 3

About Me

About Me

Ahtozz

At vix patrioque scribentur at fugitertissi ext scriptaset verterem molestiae
  • Opens in a new tab
  • Opens in a new tab
  • Opens in a new tab

Recent posts

  • ea molestias quasi exercitationem repellat qui ipsa sit aut
    August 29, 2025/
    0 Comments
  • qui est esse
    August 29, 2025/
    0 Comments
  • sunt aut facere repellat provident occaecati excepturi optio reprehenderit
    August 29, 2025/
    0 Comments
  • Add ajax to contact form 7 in elementor popup
    October 17, 2024/
    0 Comments
  • Change wp-admin login url and logo
    September 6, 2024/
    0 Comments
January 2026
M T W T F S S
 1234
567891011
12131415161718
19202122232425
262728293031  
« Aug