• Hello,

    I would like to print all subcategories from a category with featured images.

    Now I have code which allows me to print all subcategories from parent category and this subcategories remains on the page even if user will choose other subcategory from parent category (it shows siblings subcategories from a parent category).

    The code works well and now I would like to combine it with Categories images plugin to get all images corresponding to subcategories, can you help me please?

    The code for displaying subcategories

    <?php
        if (is_category()) {
        $this_category = get_category($cat);
        }
        ?>
        <?php
        if($this_category->category_parent)
        $this_category = wp_list_categories('orderby=id&show_count=0
        &title_li=&use_desc_for_title=1&child_of='.$this_category->category_parent.
        "&echo=0"); else
        $this_category = wp_list_categories('orderby=id&depth=1&show_count=0
        &title_li=&use_desc_for_title=1&child_of='.$this_category->cat_ID.
        "&echo=0");
        if ($this_category) { ?>
    <ul>
    <?php echo $this_category; ?>
    </ul>
    <?php } ?>

    Thank you very much

    Best regards
    Peter

    https://wordpress.org/plugins/categories-images/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Subcategories images’ is closed to new replies.