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 […]
Category: WP Tutorials
Rev Slider using Neilo Feature Image
Posted onSo here was our full filter function previously that is for Rev Slider to pull the Nelio Feature image if the post doesn’t have a feature image already set. My client almost never sets a feature image and this snippet had been working for us until version 2.0. In Rev Slider we have the background […]
How to Modify Featured Images in WordPress
Posted on1. Automatically set featured image in WordPress Using featured images in WordPress is easy and relatively simple to set up even if your theme doesn’t support the feature from scratch. We have already shown you how to set and display the basic featured image, and you will learn how to check if there is a featured […]
Display Post Thumbnail Without Being Featured Image
Posted onJust 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 onI 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 […]