On posts you can enabled comments by default. But for pages or Custom post type you have to enable it using custom code.To enable it on pages or custom post type you can put this code in active theme functions.php or Code Snippet plugin … [Read more...] about Enable Comments on Page or Custom Post By Default
Wordpress
How to replace post content image with Full-Size image
You can replace thumbnail or any small size image from post content with the full-size images. To replace small size images we can use the_content filter and replace images with full-size images. Here filter use images class with thumbnail id to get the original image and then it replaces it … [Read more...] about How to replace post content image with Full-Size image
Open external links in new tab
External links are opened in new tabs always. You can set this easily on WordPress theme by just adding this snippet in functions.php of your theme. … [Read more...] about Open external links in new tab
Add a Dynamic Cart Icon in Primary Menu
We can add a dynamic cart icon on the primary menu very easily. You just need to add font-awesome fonts on your website otherwise you can use simple cart text on place of cart icon. To add a dynamic cart icon with the number of counts you just need to add this code in your active theme … [Read more...] about Add a Dynamic Cart Icon in Primary Menu
Show the Post Updated Date
Sometime in post entry meta, you may need to show the post updated date. To get the updated date of any post you get can use get_the_modified_date. But what happened if the updated date and the publish date, both are same.Then you can use this code to get the updated date and show on any place on … [Read more...] about Show the Post Updated Date
Remove Query String from Static Resources
Sometimes you have seen Remove Query String from Static Resources during checking website performance on GTMetrix, Pingdom Test Tool, and Google PageSpeed Insights. In all options to increase website performance, there is one option is to remove query string from static resources.You can simply … [Read more...] about Remove Query String from Static Resources
Set the first image as featured image
To set the first image as a featured image for a post in WordPress you can use the following hooks.Featured image is required for all posts as maximum blogging themes look perfect if you have featured image uploaded, and this featured image also required for providing meta image data for the posts … [Read more...] about Set the first image as featured image
Hide Coupon Form if a Coupon is already applied
Sometimes it is required and you want to hide coupon form if a coupon is already applied on cart. You can use woocommerce_coupons_enabled filter to do it easily. You just need to check if any coupon already applied by using the global $woocommerce object. If there is any coupon already applied on … [Read more...] about Hide Coupon Form if a Coupon is already applied