How get a category list using custom query in wordpress?


Hello Everyone,

If you want reterieve a category list any where in your theme page then use this code

<ul> 
<?php
 wp_list_categories('orderby=name&include=3,5,9,16');
//here 3,5,9,16 is the category id,so you can change this according your requirement
 ?> 
</ul>

Please have a look on on this link http://codex.wordpress.org/Template_Tags/wp_list_categories for more option

 

Enjoy Code!

Advertisements

Sr. Software Engineer

Posted in Wordpress
2 comments on “How get a category list using custom query in wordpress?
  1. Thanks in support of sharing such a nice thinking, post is fastidious,
    thats why i have read it fully

  2. Unquestionably imagine that which you said. Your favourite reason seemed to be
    on the net the simplest thing to understand of. I say to you, I definitely get annoyed whilst other folks consider concerns that they
    just do not recognise about. You managed to hit the nail upon the top and also outlined out the entire
    thing with no need side effect , people can take a signal.
    Will probably be again to get more. Thank you

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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: