10 Most Wanted Category Hacks and Plugins for WordPress

In this article we will share the most wanted category hacks and plugins for WordPress which you can use in your themes. These snippets of codes are a lifesaver in many situations when it comes to modifying a theme. 1. Display Certain Categories in a Menu: In many cases, users only want to display certain categories in their navigation menu at the top of the page. There are limited spots, that can only be filled by top categories, but if you use the default wp_list_categories code, it will show all categories. This is why this hack below comes in very handy when you want to create a navigation menu and only display certain categories. Note, you can also change the ‘include’ text to ‘exclude’ and show all categories and exclude those that you don’t want displayed. The numbers displayed in the code are the category IDs. Remember since WordPress shows categories in a list format, you will need to edit the CSS in order to make it work. 2. Display Category in a Dropdown Menu: Some blogs have a lot of categories which they can’t display in their sidebar. Or some bloggers do not want to take up a lot of space displaying categories. This option allows them to have a select menu, dropdown menu, for categories. See WordPress Codexfor details.
]*)>#", " 3. Exclude Certain Categories from Being: Displayed in a Loop Your blog page shows recent posts from all categories. If you want to have a separate page for some reason, or do not want to display certain categories, you can use the following code, and it will exclude a certain category from being displayed in a Loop. Just change the category IDs. 4. Display the Most Recent Posts from a Specific Category: This code comes in handy when you want to display posts from a specific category on your homepage, or in your sidebar. A live example of this code can be seen at Balkhis.com. The code below will show 1 post with the excerpt from category 3. You can modify the numbers as you desire.
To only show links from the category use the code below:
5. Exclude a Specific Category from RSS Feeds: There are certain categories that contain maybe link love and others which most of your users are not interested in. This is the option to satisfy those users. You can exclude a specific category by using a plugin called Advanced Category Excluder, or you can do it manually by using the code below: http://example.com/feed?cat=-5. To exclude multiple cateogries, just use the ampersand symbol: http://example.com/feed?cat=-4&cat=-5. If you don’t want to use the plugin and don’t want to do it manually with the link. There is another way which you can use by editing your function.php. Paste the following code in it: function myFilter($query) { if ($query->is_feed) { $query->set('cat','-5'); //Don't forget to change the category ID =^o^= } return $query; } add_filter('pre_get_posts','myFilter'); 6. Make a Separate RSS Feed for Each Category: Often times bloggers wonder how to make separate RSS feed for their category. Because sometimes your user only visits your website for the design category, but you have ten other categories that the user is not interested in. This hack will take care of this issue. http://www.olcenter.blogspot.com/category /showcase/feed/ All you have to do is add the word feed in front of the category URL, and it will take you to the feed for that specific category. If you want to display a RSS icon in front of category listings then use the code below: You must make sure to change the URL of the image because this will display RSS icon in front of each category. 7. Assign an Author to a Specific Category: On Blogs that have multiple authors, it is wise to assign authors to specific categories to avoid confusion. This plugin limits the user to publishing into the categories he/she is assigned. 8. Show Post Excerpts on Category Pages: Sometimes in order to prevent duplicate content, and make your category pages easy to browse, it is recommended that you use excerpts instead of displaying full posts. Category pages are indexed like normal blogs are in chronological order, so if you have a post that is 1000 words and 25 images, and you are displaying 5 posts on each page. It will be a hassle for your user to go through category archives. Therefore we suggest you show excerpts instead of full posts on category pages. Then you just direct them to the single post page where full text is written. It also helps pageviews for those who are addicted with stats. First you would need to openindex.phpand locate this code: and replace it with: Now when you write posts, just write a custom excerpt to make it more interesting. 9. Show Category Icons Pictures make a site more lively which is a given which is why blogger might want to associate pictures with their category. This plugin lets you associate a specific icon of your choice to a designated category. You can use this plugin to list categories by icon with or without names, and much more. 10. Display Category Description in Template: Displaying category description on category pages are considered to be more SEO Friendly. But this is often used when running a modified theme in which you have subcategories within a category. When you have separate category pages customized displaying category description is always a good edition. This is the description that you type when creating a category in your WordPress admin panel. Add the following code in your archive.php / category.php whichever one is more appropriate for you:
Share on Google Plus

About K. M. Emrul Hasan

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment