How to Get a WordPress Category Name without the Link

By admin / 12:21 pm, 15 May 2017 / Wordpress / 0 Comment

If you ever have the need to display the name of your current category without a link, the following code will let you do that.

How to change wordpress custom logo and logo link class

By admin / 12:34 pm, 4 Apr 2017 / Wordpress / 0 Comment

For change custom-logo-link and custom-logo class add this filter function to your functions.php, i.e., add custom class to wordpress logo and logo link

Adding Scripts and Styles to WordPress the Right Way With Enqueueing

By admin / 12:15 pm, 1 Mar 2017 / Wordpress / 0 Comment

In this article I’ll show you how to add scripts and styles to your themes and plugins, whether you are creating something on the front-end or in the backend.

Enqueueing is a way to let WordPress know about your scripts and their dependencies. Based on this, WordPress works out the placement of the script for you. Since this is all done by code you won’t have to worry about rearranging scripts when you need to add a new one. Let’s go through the scripts in the previous section, adding them by enqueueing:

This code should be placed in the functions.php file of our theme, child theme, or in a plugin file. Note that both scripts and styles are enqueued by attaching a function to the wp_enqueue_scripts hook.

Change WP default sub menu class

By admin / 7:13 pm, 23 Feb 2017 / Wordpress / 0 Comment

In WordPress, all sub-menus have the class ‘sub-menu’. To change it to a custom class, add the following code in your functions.php file.

Display only one category in a custom post type

By admin / 1:11 pm, 17 Feb 2017 / Wordpress / 0 Comment

How to Display a Custom Post Type in WordPress

By admin / 4:18 pm, 12 Jan 2017 / Wordpress / 0 Comment

So, you’ve added custom post types to the WordPress admin and now you’re wondering how to display them. This tutorial will show you how you can display custom post types, complete with custom fields and taxonomy, on the site’s front-end.

Quick tip: Use wp_trim_words() to limit words in WordPress

By admin / 10:13 pm, 26 Jun 2016 / Wordpress / 0 Comment

Using wp_trim_words() allows us to limit the title and excerpt, and anything else really, to a particular number of words. You can define the number of words to limit them to, and also define what you’d like the “more” text to be.

WordPress 3.3 brought a handy little function with it in wp_trim_words(). An example use case is a height limited box like the one pictured, where you want to make sure that the title and excerpt don’t cause the text to overflow the box.