Title: If is_subcategory&#8230;
Last modified: August 19, 2016

---

# If is_subcategory…

 *  [levani01](https://wordpress.org/support/users/levani01/)
 * (@levani01)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/if-is_subcategory/)
 * Is there any conditional tags which executes different action if it’s subcategory
   and different if it’s parent category and/or home page?
 * Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [mihapirc](https://wordpress.org/support/users/mihapirc/)
 * (@mihapirc)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/if-is_subcategory/#post-997477)
 * `$categoryvariable=$cat;
    $is_subcategory = $wpdb->get_var(“SELECT parent FROM
   $wpdb->term_taxonomy where term_id=”.$categoryvariable.””); if($is_subcategory!
   =0){}
 * Also found this [link](http://snipplr.com/view/10275/wordpress-in-subcategory/).
 * Hope it helps …
 *  [mihapirc](https://wordpress.org/support/users/mihapirc/)
 * (@mihapirc)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/if-is_subcategory/#post-997478)
 * And this [link](http://yoast.com/showing-subcategories-on-wordpress-category-pages/).
 * Best regards …

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘If is_subcategory…’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [mihapirc](https://wordpress.org/support/users/mihapirc/)
 * Last activity: [17 years, 2 months ago](https://wordpress.org/support/topic/if-is_subcategory/#post-997478)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
