Android & Wordpress Help center

Playing with wordpress categories

People often like to publish their posts under some categories, this helps them to organise better. Even this post is under Category “WordPress” 🙂

So how to get information about a category??
here is a smart and easy way.

To get the ID of a category use this :

$cat_id = get_cat_ID("category name");

To get all the information associated with this id :

$cat_id = get_cat_ID("category name");
$cat_information = get_category($cat_id);

get_category() returns an object that contains all the information related with a category. The information can be accessed like this ::



Single Post Navigation

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: