Support » Plugin: Easy Category Icons » get_the_icon not working (please help)

  • Trying to get this plugin working and have done quite a few variations of this code. I ended up looking at your PHP code (for displaying the medium icons in the admin panel, etc) for how to pull this off.

    Here’s what I have:

    `<div class=”category_icon”>
    <?php

    $arr = templ_get_the_icon(array(‘size’=> ‘small’),’category’,$term->term_id);
    $cat = $arr[0];
    $icondata = $arr[1];
    $icon = $icondata[0];
    $width = $icondata[1];
    $height = $icondata[2];
    $output = “<img src=’$icon’ title=’$title’ alt=’$cat_title’ id=’templ_icon_$id’ width=’$width’ height=’$height’ />”;
    echo $output;
    ?></div>`

    But it’s not working. Any suggestions?

    • This topic was modified 4 years, 10 months ago by lukemunn.
Viewing 1 replies (of 1 total)
  • try this one – its working

    <?php
    $categories = get_terms( ‘listing’, array(
    ‘orderby’ => ‘count’,
    ‘hide_empty’ => 0
    ) );

    if ( ! empty( $categories ) && ! is_wp_error( $categories ) ) {

    echo ‘<ul id=”categories”>’;
    foreach ($categories as $term) {
    $arr = templ_get_the_icon(array(‘size’ => apply_filters(‘templ_icon_size’,’small’)),$term->taxonomy,$term->term_id);
    echo ‘

    • This reply was modified 4 years, 5 months ago by crea8xion.
Viewing 1 replies (of 1 total)
  • The topic ‘get_the_icon not working (please help)’ is closed to new replies.