Adding the following in child theme’s functions.php will display the word count in post info on single post pages in Genesis: add_shortcode( ‘word_count’, ‘func_word_count’ ); /** * Register custom [word_count] shortcode to display the number of words in a post. * * @return word count. */ function func_word_count() { $content = get_post_field( ‘post_content’, get_the_ID() ); […]
Free Content
How to exclude Posts having a specific tag from Genesis Featured Posts
In GenesisWP Slack channel, a user asked: Using the inbuilt Genesis Featured Posts, is there a way to exclude a specific tag from the results? Wondering if there’s a way using pre_get_posts… So posts with a specific tag don’t show in genesis featured post widgets. This can be done using Custom Genesis Featured Posts Widget […]
How to remove Scripts section from Pages of a specific Page Template in Genesis
In the comments section of The Comprehensive Guide to Genesis Theme Supports, a user asked: how can I remove the inpost scripts for a certain page template? Adding the following in child theme’s functions.php will make Scripts section to not appear for static Pages to which page_products.php template has been applied. add_action( ‘init’, ‘custom_remove_scripts’, 11 […]
How to set up URLs similar to StudioPress theme demos for third party Genesis theme demos
The problem I want to visit Showcase Pro theme’s demo site. In my browser (Chrome), I start typing demo and the browser history suggestion list shows me something like: I change the last part of the URL from infinity to showcase and hit return. The result is a page in Maintenance Mode (in this case) […]
How to replace class with an ID for Title Area in Genesis
In the members-only forum, a user asked: Hi All
> I’m a bit stuck on using attributes to alter markup. I’d like to replace the title-area css class with an ID of title-area and I’d rather not rewrite the do_header area. This can be done using genesis_attr_<context> filter hook. Add this in child theme’s functions.php: add_filter( […]
How to make secondary navigation menu mobile responsive in Genesis
In the comments section of How to add a responsive mobile menu before footer in Focus Pro, a user asked: I need to add a menu similar to the one in this tutorial and doesn’t seem to be working with the current sample theme – I think it’s because the responsive code is different in […]
How to set up WordPress Coding Standards in Visual Studio Code
I am slowly moving away from Sublime Text to Microsoft’s Visual Studio Code due to VS Code’s superior feature-set like a built-in file navigation tree (which is better than ST’s SideBarEnhancements package), IntelliSense and built-in Git. Below are the steps to have VS Code automatically sniff and display warnings/errors (if any) in your PHP files […]
How to automatically add item label as a class for nav menu items in WordPress
Updated on July 08, 2017 Let’s say you have a nav menu in your WordPress site with these items: Home About Blog Shop Contact In WordPress, it is possible to manually set a class for nav menu items when editing custom menus. Your custom classes can then be used to uniquely style the nav menu […]
How to Filter Posts by Categories using FacetWP in Genesis
Updated on July 05, 2017 FacetWP is a premium plugin for setting up fast and easy facets (filters) of various kinds like select menus, checkboxes and radio buttons. This tutorial covers the steps to display categories’ checkboxes in a text widget on Posts page, archives and search results pages using FacetWP. Posts can be filtered […]
Genesis Simple Hook Guide
Ever since I switched to Genesis for all my WordPress websites a few years ago, there’s one site that was always open in my browser tab: Genesis Visual Hook Guide by Christopher Cochran. Even though there is a plugin version of the same, I’ve always preferred just to refer to hooks in the various views […]
Recent Comments