How to get Custom post type by related category ID

After two days with this problem have resolved the problem, I fix it adding tax_query parameter with my taxonomy name and slug of the category requested: $args = array( ‘post_type’ => array ( ‘servicios’ => ‘servicios’, ), ‘tax_query’ => array( array( ‘taxonomy’ => ‘category’, ‘field’ => ‘slug’, ‘terms’ => ‘dgit’ ) ) );

Create a WordPress Database query to find users who purchased specific product through WooCommerce [closed]

You’ll find details here: https://gist.github.com/lukecav/05afef12feaf980c121da9afb9291ad5 OR Another approach is https://github.com/woocommerce/woocommerce/wiki/wc_get_orders-and-WC_Order_Query . Use if….else and store order data in Arr[product_id] = OrderArr Kindly accept my answer if it is of any help.

Add a class to a menu item depending on a body class

Use the nav_menu_css_class() filter. The following function will add the current-menu-item class to a page identified by it’s slug. You can Update the $cpt_name and $menu_item_id variables to reflect your setup. add_filter( ‘nav_menu_css_class’, ‘nav_parent_class’, 10, 2 ); function nav_parent_class( $classes, $item ) { $cpt_name=”team”; $menu_item_id = 127; // id of menu item to add current-menu-item … Read more