I have a problem to resolve. I have wordpress site with 2 pages : Food and Cooking.

I have categories : food_categories (1) and cooking_categories (2).

I want to show only food_categories on Food page and only cooking_categories on Cooking page.

Please help me to resolve it . Thanks all.

1 Answer 1


Goto your respective page template file, default is page.php and the following code

    if (is_page('Food')) {
    } elseif (is_page('Cooking')) {

To get the category ID, navigate to dashboard>posts>categories>

Click on the respective category, and see the url, it must be something like this wp-admin/categories.php?action=edit&cat_ID=11

take the value of cat_ID in this case the id will be

  • @Nguyen ngo if you got the solution then please mark this as answer Jul 6, 2011 at 5:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.