Forums

[resolved] Is_category is ignored in the category(-*).php template file (1 post)

  1. design_dolphin
    Member
    Posted 2 months ago #

    This has to deal with using meta_keys to list your posts and conditional tags in a index.php and category template file.

    In this example in the index.php I was using:

    query_posts('meta_key=your_first_meta_key_name'); $i = 1;

    then in the category(-*).php file I had to use:

    query_posts("category_name=your_category_name&meta_key=your_second_meta_key_name"); $i = 1;

    instead of:

    query_posts("meta_key=your_second_meta_key_name"); $i = 1;

    Otherwise it would ignore the is_category('your_category_name'), is_category('#') and is_category('Your category name') conditional tags, and instead only listen to the is_home() or is_front_page() conditional tags, if these conditional tags are present in the category(-*).php template file.

Reply

You must log in to post.

About this Topic

Tags

No tags yet.