Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

1 Answer 1

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

<?php
    if (is_page('Food')) {
      $catID=11;
    } elseif (is_page('Cooking')) {
      $catID=12;
    }
?>

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

 
discard

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.