Sort products without thumbnail in WooCommerce shop page

I would try to rename the custom function and add meta_query too! So it’d be like this: function my_shop_custom_products_query( $q ) { $q->set( ‘meta_key’, ‘_thumbnail_id’ ); $q->set(‘orderby’, ‘meta_value_num’); $q->set(‘order’, ‘DESC’); $q->set( ‘meta_query’, array( array( ‘key’ => ‘_thumbnail_id’, ‘compare’ => ‘>=’, ‘value’ => ‘0’ ))); } add_action( ‘woocommerce_product_query’, ‘my_shop_custom_products_query’ ); If for some reason it didn’t … Read more

How to handle a missing page.php?

The only required template in a WordPress theme is the index.php. And a comments.php if comments are supported. Following the template hierarchy, all other files, including page.php, will fall back to the index.php. When a theme doesn’t have a page.php, look at the index.php. There you will find the basic structure for its content. In … Read more

Get only one product category woocommerce

Before I begin, just one note, there is no property called $all in get_the_terms. Here are the available fields which you can use stdClass Object ( [term_id] => [name] => [slug] => [term_group] => [term_order] => [term_taxonomy_id] => [taxonomy] => Get only one product category woocommerce => [parent] => [count] => [object_id] => ) I’m … Read more

Invalid shipping method, WooCommerce [closed]

May be you have just enabled the ‘Enable shipping’ from shipping options page(Woocommerce -> Settings -> Shipping ). You need to enable the Shipping Methods also. For enabling shipping methods click on shipping method name from shipping methods table displayed on shipping options page. Check the checkbox ‘ Enable this shipping method ‘ and save … Read more

Add my own function to existing WooCommerce hook

storefront_single_post hook pertains only to single posts and not products although products are considered posts of type ‘product’ This is the hook you need: add_action( ‘woocommerce_single_product_summary’, ‘storefront_post_header_categories’, 6 ); function storefront_post_header_categories() { echo “code to display categories here”; } You will find it in plugins/woocommerce/content-single-product.php: /** * woocommerce_single_product_summary hook * * @hooked woocommerce_template_single_title – 5 … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)