WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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

share|improve this answer
Greate. Thank ntechi so much – Nguyen ngo Jul 6 '11 at 4:18
@Nguyen ngo if you got the solution then please mark this as answer – ntechi Jul 6 '11 at 5:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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