Displaying Woocommerce Product Category in WordPress

woocommerce categories are not a “category” they’re the product_cat taxonomy. change your args like so: $params = array( ‘posts_per_page’ => 5, ‘post_type’ => ‘product’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘product_cat’, ‘field’ => ‘slug’, ‘terms’ => ‘cap’ ) ) );

Which field should I edit to make the checkbox marked by default?

It most likely must is ‘default’ => TRUE. ‘request_vendor_access’ => [ ‘label’ => __(‘Request access to become an Artist’, ‘ignitewoo_vendor_stores’), ‘type’ => ‘checkbox’, ‘required’ => FALSE, ‘class’ => [‘form-row-full vendor_stores_request_access’], ‘clear’ => TRUE, ‘default’ => TRUE, ] If not, also try ‘default_value’ => TRUE, or try it without ‘clear’. Depending on what you want to … Read more

How to bypass maintenance mode with external cron?

It’s been awhile since the moment of the question, but maybe a solution will help someone in the future. Just define IS_WP_CLI variable in the beginning of your script . … define(‘IS_WP_CLI’, true); // Avoid maintenance mode require_once HOME_PATH . ‘/wp-load.php’; … If IS_WP_CLI defined -> maintenance mode will not be instantiated. if (defined(‘IS_WP_CLI’)) { … Read more

get author_name from queried post

The problem with your code lies in these three lines: $queried_post = get_post($post_id); $author_id = $queried_post->post_author; $first = $user_info->user_nicename; You correctly get authors ID, but then you try to get some field of user_info variable, which is not defined anywhere in your code. One way to fix it is to get user info (using get_userdata) … Read more