get_tags
is just a wrapper around the more general taxonomy function get_terms
. So you’ll get the result you need with this:
function execute_taxography() {
$wpbtags = get_terms( 'books' );
$output.= '<div class="grid"><div class="taxography-grid"><ul>';
foreach($wpbtags as $tag) {
$output.= '<li class="item"><a href="'. get_term_link($tag->term_id, 'books' ) .'" style="background-image: url(\'http://localhost/wordpress/wp-content/uploads/tags/' . $tag->slug . '.png\')"><span class="count">'. $tag->count .'</span><span class="taxography-name">'. $tag->name . '</span></a></li>';
}
$output.= '</ul></div></div>';
return $output;
}
I’ve also replaced function get_tag_link
with get_term_link
.
Read about get_terms
at https://codex.wordpress.org/Function_Reference/get_terms. Read about ‘get_term_link` at https://codex.wordpress.org/Function_Reference/get_term_link