WordPress Themes, Plugins, Tutorials, Tips And More...

Tag: Category

How To Exclude Certain Categories From Your WordPress Website HomePage

ACE - 2

Sometimes there comes a specific time when you want to exclude certain categories from WP homepage. It means that you don’t want some specific categories to appear on your site’s homepage. The thing sometimes just due to requirements which come in front of you or sometimes as you wishes to experiment the things at an extra par. In this article we talk about two ways by which you can achieve the action – one by using the plugin and second by going onto the manual way.

Using The Plugin: Advanced Category Excluder

The plugin works as a content separator, content manager, content excluder, and sidebar widget manager plugin to enable CMS like functionality. The plugin works on its main goal: to enhance WordPress functionalities, to hide some unwanted categories, from defined parts of the blog.

More Info | Download

Manual Way

  • Make sure you keep a note of the category you want to exclude.
  • Now open your “index.php” file with the editor.
  • You need to search for the code line: <? PHP if (have_posts ()) : while (have_posts ()) : the_post (); ?>
  • On finding the required code line, now put the following code before that line: <? PHP if ( is_home () ) { query_posts ( ‘cat=-X’ ); } ?> ; where X represents the category id of your directory.
  • If you want to exclude various categories, you just need to put a comma and type other id after that. It can be like this: <? PHP if ( is_home () ) { query_posts ( ’cat=-X, -Y, -Z’ ); } ? > ; where X, Y, Z represents various IDs of your directories.
  • Now select the option “Update” and you are done.

How To Find A WordPress Post, Category And User ID

Admin

While working on WordPress, you may come across conditions where you feel like the need arise on getting to know you WordPress post, category and user ID. Although the task of finding the ID is quite a simple one but sometimes it may even confuse an advanced WordPress user also. In this article we will show you how to find different IDs which come beneath under WordPress.

Finding Page/Post ID

Once you logged into your WordPress dashboard, Go to Manage > Pages and from the Pages list, hover over to one of the Page title of which you want to find the ID of. You will notice the URL in the following way:

http://www.example.com/wp-admin/page.php?action=edit&post=60

The number with which the URL ends is the Page ID (60 in this case).

Finding Category ID

Go to Posts > Categories and click on the category name. The category will get open in an editor and you will then be able to see the category ID by looking onto your browser’s address bar. You will notice the URL in the following way:

http://example.com/wp-admin/edit-tags?action=edit&taxonomy=category&post_type=post&tag_ID=4&post_type=post

The number with which the tag ID represents is the Category ID (4 in this case).

Finding User ID

Go to Users >All users and click on the user name. User’s profile will get open and you can then get the user ID from browser’s address bar. You will notice the URL in the following way:

http://example.com/wp-admin/user-edit.php?user_id=20

The number with which the user ID represents is the User ID (20 in this case).

Photo Credit: Flickr/Konrad Twardowski

Note: Like the post, then make sure you do follow and like us on both Twitter and Facebook.

Showing WordPress Categories With Different Icons

You would often be wondering that what possible can be done in order to have different icons on board for different categories instead of just regular WordPress categories. The thing may even confused you at par, but when in actual will tell you that having an icon for WordPress category is a real simple process, then I am sure that any of you who would be real interested would love to have that change in categories as soon as possible. There are two ways by which you can achieve this – either by opting for code for your theme or by using a plugin.

Category

Using Short Code

You can use the following code in your WordPress theme at the place where you want the icon to show off, replacing the traditional way which you have been seeing since from the time you started with WordPress. Make sure the outputs category images have to be named after cat_ID with the alt attribute set to cat_name plus you can also use any of other member variables instead.

Source: WordPress Codex

Using “Category Icons” plugin

The plugin lets you associate a unique icon with each of your WordPress categories in order. The icons you use will make your category pages better than other category pages already out there. The plugin comes with pre-configuration, means you will get everything configurable from the settings menu. You can use the icons on your index page, post pages as well as on sidebar.

Key Features:

  • displays one or more icons in front of your post title or wherever you want
  • displays icons in the sidebar, with or without the category name, with or without the help of the widget
  • includes a widget. You can use multiple Category Icons widgets, include or exclude some categories, display only icons (i.e. without the category name)…
  • you can make rollover with the icons in the sidebar if you follow this tutorial
  • is able to display category icons in your RSS
  • will either show you where to place the little code needed (template tag) in your themes
  • generates pure html code of the img tag, so it gives you the freedom of doing what you want to with the icons (customizing via CSS or not)
  • generates valid XHTML (and Strict XHTML)
  • can prioritize the icons display (by Oliver Weichhold)
  • is translated in more than 20 languages (all the .po files are included, in case you want to update your language).
  • is compatible with these powerful plugins : My Category Order, qTranslate, Recent Posts, SEO Friendly Images, Similar Posts
  • is compatible with WordPress Network

More Info | Download

Photo Credit: Flickr/Andy Melton

Powered by WordPress & Theme by Anders Norén