• How to get category icon url any where in my front end?

    I have created one function in my function.php

    function get_cat_icon($id,$key=”){
    global $wpdb;
    $strTable = $wpdb->prefix.”termmeta”;
    $icon_id = $wpdb->get_var( “SELECT meta_value FROM “.$strTable.” WHERE term_id = “.$id.” AND meta_key = ‘”.$key.”‘” );
    $src = wp_get_attachment_image_src( $icon_id, ‘thumbnail’ );
    return $src[0];
    }

    This is working. but I want to know if you have implemented something else?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get category icon url’ is closed to new replies.