Want to add a custom attribute like target=”foobox” or data-featherlight=”#enews-popup” to a specific nav menu item’s anchor? nav_menu_link_attributes filter hook in WordPress is your friend. For example, adding /** * Add custom attribute and value to a nav menu item’s anchor. * * @author Sridhar Katakam * @link https://sridharkatakam.com/ */ add_filter( ‘nav_menu_link_attributes’, function ( $atts, […]
Free Content
Genesis Sample’s Functions per WordPress PHP Documentation Standards
I’ve recently set up WPCS (WordPress Coding Standards) in my editor, Sublime Text and have since been diligently adding appropriate comment blocks for the various code I use/write, thanks to the linting or automatic code suggestions. Looking at the code in the current latest Genesis Sample 2.2.4’s functions.php, there are minor improvements that can be […]
How to disable wpautop on specific Page(s) in Genesis
WordPress has a useful feature called wpautop (WordPress Auto Paragaphs) that automatically adds paragraphs and line breaks when WordPress editor is used in Text view. There may be times when you need to add a lot of HTML code in the Page editor and find that WordPress is messing up the output by adding unwanted […]
How to remove “Select options” button from variable products on the main WooCommerce shop page
Updated on August 20, 2018 In Genesis Slack‘s WooCommerce channel, a user asked: Totally random question but does anyone know how to remove the “Select Options” button in WooCommerce Shop Main page? woocommerce_loop_add_to_cart_link filter hook can be used to remove the Select options buttons for each variable product. Add the following in child theme’s functions.php: […]
How to exclude Page(s) from Genesis Archive Page Template
In the members-only forum, a user asked: Hi Sridhar, I cannot find anything that worksā¦ how can I leave out a few pages, like āthank youā pages in the page_sitemap.php in Genesis. In my case, I am using your genesis-sample-master and I want to leave out Page ID:11 and ID:720. The Genesis Archive Template uses […]
Theme Logo in Genesis
Theme Logo is a theme feature, first introduced in Version 4.5. This feature allows themes to add custom logos. Theme/Custom Logo feature is the recommended method for adding logos in WordPress versus using the Custom Header especially with the built-in schema benefit of itemprop=”logo” microdata for the logo image element. In this article, I share […]
How to add File Size admin column in WordPress Media Library
Looking to add file size column in the WordPress media library? Add the following in child theme’s functions.php: If you would like to use a plugin for the same, here are a few options: Media Files Tools Admin Columns References: http://wordpress.stackexchange.com/a/195842/14380 https://codex.wordpress.org/Function_Reference/size_format
How to add a URL admin column in WordPress Media Library
Update on February 12, 2017: Created a Plugin version of this. See near the end of this post. Wouldn’t it be handy to be able to easily copy a media item URL directly on the main Media Library screen rather than having to open the item? The following is better formatted version of this code […]
How to add a Time admin column in WordPress Media Library
Looking to display the time at which media has been attached/uploaded to your WordPress library along with the date? Add the following in your child theme’s functions.php: add_filter( ‘manage_media_columns’, ‘sk_media_columns_time’ ); /** * Filter the Media list table columns to add a Time column. * * @param array $posts_columns Existing array of columns displayed in […]
How to move post info above title in Genesis Featured Posts widgets
In the comments section of Custom Genesis Featured Posts Widget plugin tutorial, a user asks: First of all, thank you for this plugin! However, Iāve been busy the last two hours trying to move the entry-meta above the titleā¦to no avail! Could someone please point me in the right direction. Where to pass the $args[ābefore_title]? […]
Recent Comments