• Resolved Diogo15

    (@diogo15)


    $cats = get_categories();
    foreach ( $cats as $c ) {
        $url = get_category_link( $c->term_id );
        $img = $taxonomy_images_plugin->get_image_html( 'detail', $c->term_taxonomy_id );
        if( !empty( $img ) )
            print '<a href="' . $url . '">' . $img . '</a>';
    }

    hi, if a place this code(from plugin page) inside a sidebar or widget, it doesnt works, if there is anybody how have made a plugin or widget help me i’ll preciated your support,… this is the error:

    Fatal error: Call to a member function get_image_html() on a non-object in /home/codigo12..../.././..

    I tried to place “global $wpdb;”, but it doesn work!..

Viewing 1 replies (of 1 total)
  • Thread Starter Diogo15

    (@diogo15)

    I did it!!!!….
    Just place:

    global $taxonomy_images_plugin;

    Inside the widget registration!…

Viewing 1 replies (of 1 total)
  • The topic ‘Taxonomy image in WIDGET’ is closed to new replies.