Forums

[resolved] how to get child categories for current category? (3 posts)

  1. billpeace
    Member
    Posted 4 months ago #

    if(is_category){
    !* I want to get all child categories ID
    so how ?
    }

    thanks

  2. MichaelH
    moderator
    Posted 4 months ago #

    <?php
    if ( is_category() ) {
    $child_cats = get_categories('child_of='.get_query_var('cat'));
    }
    ?>

    See Function_Reference/get_categories

  3. billpeace
    Member
    Posted 4 months ago #

    Thanks

Reply

You must log in to post.

About this Topic

Tags

No tags yet.