Hide the Description and Reviews Tabs in WooCommerce Products
WooCommerce products by default show ‘description‘ and ‘reviews‘ tabs below the product on a WordPress product page, you can hide these tabs from view as well as a third tab ‘additional information‘ with a snippet of code that goes in your themes functions.php file As well as remove the tabs you can rename the heading…
Read MoreChange @WordPress from email address and from name sent out from website
WordPress sends a few emails out from a website including password reset emails that have a from email address [email protected] they also have a from name of WordPress. Two WordPress filters can change these values wp_mail_from and wp_mail_from_name – add the below code in your child themes functions.php and change the appropriate values. add_filter(‘wp_mail_from’, ‘prefix_email_from’);…
Read MoreAdding a loading icon spinner on Search & Filter Pro Archive Page
Search & Filter Pro is a great WordPress filter tool, here is a guide to add a loading icon animation whilst the page is ajax refreshed when the user has selected a filter request and is waiting for the page to load the new results. The plugin author has made 2 event callbacks where you…
Read MoreAdd a Different CSS Body Class to a Page in WordPress
Using WordPress filter ‘body_class‘ you can add a unique CSS class to the body element of a page by passing in what pages you want the new CSS class applied to. So in the above code I want an additional class ‘beaverbuilder’ applied just to the page with the ID of 8. This code will…
Read MoreFiltering the Gallery Image Output in WordPress – Adding Class or Data Attribute
To manipulate the linked images, specifically the links themselves in the WordPress Gallery output for doing things like adding in a CSS class or a data attribute value you can use the post_gallery filter in /wp-includes/media.php which is the right tool for the job. The filter can be applied like so… So this is an exact copy of the original…
Read MoreGenesis Title Toggle on Custom Post Types – Learn Dash
By default Genesis Title Toggle only works on pages, but you can enable it for regular posts and custom post types by using a filter that the plugin comes with – in the example below I need it enabled for the default custom post types that come with Learn Dash. So in the snippet above…
Read MoreAdding Classes and Attributes to HTML elements in Genesis
Attributes can be added into various HTML markup elements via filters in the Genesis Framework, these attributes can be adding in an ID or additional CSS Class, or amending the Microdata Schema including role, itemscope or itemtype attributes. The HTML markup elements/sections also known as ‘contexts‘ are originally declared as functions in the core Genesis Framework in:…
Read MoreAdd HTML Tags and Attributes back into Comments in WordPress
Since WordPress 3, the notice of being able to use HTML Tags and Attributes has been removed and there is just an empty string, which means that the use of the allowed tags in comments is still feasible but readers may not know. You can add this notice back in using the filter comment_form_defaults Add in…
Read MoreIncrease JetPacks Amount of Related Posts in WordPress
By default the related posts module from JetPack shows 3 related posts at the end of a regular single post in WordPress. You can use a JetPack filter to increase the amount of JetPack related posts with – jetpack_relatedposts_filter_options. You would use it like so… Just change the number to how many related posts you want…
Read MoreRemove Default Sort in WooCommerce and ‘Showing All Results’ Notice
In an e-commerce environment using WooCommerce when there is only a few products to sell, it is cleaner and more intuitive to rid the space of some clutter – such as the ‘Default Sorting‘ options dropdown and the display notice ‘Showing all x results‘. Add this code in your themes functions.php file and you will have…
Read More