Category: WordPress

Post

How to get commenter ID in WordPress

If you want to output some data (such as biographical info or personal website) for the person who commented on WordPress post or page, you should be able to get the user ID so you could use it for the_author_meta() function.

Post

How to create custom comment walker class in WordPress

There are several walker classes in WordPress – I don’t actually know how many there are because I tend to browse the source code only if I need to change something, just as others I guess :). Regardless, I’m sure that custom navigation walker class is probably the most used and customized WordPress walker class. But...

Post

How to change a WordPress plugin function using action hooks

This is just one of the many possible scenarios on how to change a function in a WordPress plugin, but let me show you a real world example from Easy Property Listings, a really great and customizable real estate plugin. My client wanted to remove the <a> element from featured image on single property listing page. The...

Post

How to copy text from website to clipboard

So this is the scenario – you have this text on your website and would like to have a button that would allow the visitor to copy the text into clipboard using one click, without requiring them to select the text manually. Thankfully, there is a clipboard.js library, allowing us to perform different kinds of...

Post

Adding WordPress menu item description using nav_menu_item_title()

The answer to how to add description into WordPress menu items is – easy :). All you need to do is extend walker class using nav_menu_item_title() filter which came with WordPress 4.4.  So basically, all we need to do is to add $item->description where appropriate, which means inside the start_el() function which generates the menu link.

Post

How to add custom CSS class depending on the template

I know that you can achieve the same by using global variables, but this is also one of the ways to add custom class depending on which page template has been loaded (you would add this into functions.php): [crayon-594cedc7403bb693587325/]

Post

How to pass data in Gravity Forms using filter hooks

Inside Gravity Forms documentation , you can find out that you can pass data into Gravity Forms by using any of the following 3 methods: hooks, query strings and shortcodes. Let me show you how to pass data using filter hooks. Basically, what you’re looking for is  gform_field_value_$parameter_name() filter. Note the $parameter_name.

Post

How to set conditional logic in Advanced Custom Fields

If you tried to set conditional logic using Advanced Custom Fields plugin, but haven't done it before, there's a chance that you will stumble upon the following message "No toggle fields available" wondering what that means. Fortunately, it is very easy to set this up. In order to add toggle fields, you would only need to create a new custom field of "choice" Field Type and add few Choices.

Post

How to create multiple columns in Gravity Forms

If using Gravity forms, It is likely that you will require columns sooner or later. The reason is simple - gravity forms are normally not used for simple contact forms, given their power and the fact that they are not free, so licenses for GF are being purchased by clients who know exactly what are they looking for.