Is there a way to have a different featured image set for different post categories?

Posted on Leave a comment

Assuming you mean different images for posts that are in different categories, then sure. If you’re talking about customised featured images for categories then that’s a bit different, because we’re hooking post meta data here, not term meta data. For posts, all you need to do is find the primary/first category of the post… because […]

Display Post Thumbnail Without Being Featured Image

Posted on Leave a comment

Just check for the thumbnail, and if it’s not set, use the first image from the gallery instead. Something like this: $size = ‘thumbnail’; // whatever size you want if ( has_post_thumbnail() ) { the_post_thumbnail( $size ); } else { $attachments = get_children( array( ‘post_parent’ => get_the_ID(), ‘post_status’ => ‘inherit’, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => […]

Create multiple simple-product with same SKU in WooCommerce

Posted on Leave a comment

I want to create multiple simple-product with same SKU in WooCommerce. I search in admin settings but there I cannot find any settings to enable this features. Is there any hook so I can disable this features. If you want to completely disable the SKU feature then you have to use wc_product_sku_enabled filter. It will remove the […]