wordpress snippets last updated   : October 6, 2014
we now have 641 snippets
category category

Remove title attribute from wp_list_categories

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will remove the title=”” attribute from the anchor tag when using wp_list_categories().

read more

Order categories by most recently updated

wordpress snippet

Adding this snippet to your wordpress theme will display a list of categories ordered by the most recently updated category first.

read more

Add bookmark links to the wp_nav_menu

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will add bookmarks from a specified category to the wp_nav_menu. This also supports the sub-menu class so you can create pure css dropdown menus.

read more

Truncate description within categories admin panel

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will truncate the description displayed within the categories admin panel to 150 characters. Change the number 150 on line 09 to adjust the number of characters for the category description.

read more

Force categories widget to display empty categories

wordpress snippet

As you may already know the wordpress categories widget does not provide the option to display empty categories. Adding this snippet to the functions.php of your wordpress theme will force the categories widget to display empty categories.

read more

Redirect to a single post if one post in category or tag

wordpress snippet

Add this snippet to the functions.php of your wordpress theme. This snippet will redirect to the post page when a category or a tag archive has only one post.

read more