• Resolved tankmc

    (@tankmc)


    Hello,

    I have been using the plug in for a travel site and would like to list the child categories in the the parent category. I have been able to pull the title and description but are having issues getting the thumbnail. Currently i get the featured image of the page that I am on not of the category.

    Any help would be appreciated thanks.

    Here is my code:

    `<?php
    $this_cat = get_query_var(‘cat’);
    $args = array(
    ‘orderby’ => ‘name’,
    ‘order’ => ‘ASC’,
    ‘parent’ => $this_cat
    );
    $categories = get_categories($args);
    foreach($categories as $category) {
    echo get_the_post_thumbnail( $category->ID, ‘thumbnail’ );
    echo ‘<p><a>term_id ) . ‘” title=”‘ . sprintf( __( “View all posts in %s” ), $category->name ) . ‘” ‘ . ‘>’ . $category->name.'</a> </p> ‘;
    echo ‘<p> Description:’. $category->description . ‘</p>’;
    }
    ?>`

    https://www.ads-software.com/plugins/enhanced-category-pages/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author cip

    (@cip)

    Hi!

    We have updated the plugin to support passing a category id to setup_ec_data method. So please, update to v1.0.2 and use the code bellow:

    foreach($categories as $category) {
        $GLOBALS['enhanced_category']->setup_ec_data($category->term_id);
        the_post_thumbnail( 'thumbnail');
    }

    PS: It would really help us a 5 stars rating :). Cheers!

    Plugin Author cip

    (@cip)

    This has been solved so it is being marked as resolved. Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add catagory images to list of catagories’ is closed to new replies.