ilpert
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Plugins
In reply to: [Taxonomy Images] link titleHello, try this code from the plugin documentation:
$terms = apply_filters( 'taxonomy-images-get-terms', '', array( 'taxonomy' => 'product_tag', 'hide_empty' => false, ) ); if ( ! empty( $terms ) ) { print '<div class="container" style="padding-top:50px;">'; foreach ( (array) $terms as $term ) { print'<div class="listcategory" >'; print'<div class="category-content" ><a href="' . esc_url( get_term_link( $term, $term->taxonomy ) ) . '"><h2>'.$term->name.'</h2></div>'; print'</a>'; print '<div class="category-thumb">' . wp_get_attachment_image( $term->image_id, 'medium' ) . '</div>'; print '<div class="cat-description">'.$term->description.'</div>'; print '</div>'; } print '</div>'; }- This reply was modified 8 years, 5 months ago by ilpert.
Forum: Plugins
In reply to: [Taxonomy Images] image for list of terms of a taxoHello, this example is in the doc of the plugin.
Use this to retrieve the name, the link and the url of the image.
$terms = apply_filters( 'taxonomy-images-get-terms', '', array( 'taxonomy' => 'categorie_prodotti', ) ); if ( ! empty( $terms ) ) { print '<div class="container" style="padding-top:50px;">'; foreach ( (array) $terms as $term ) { print'<div class="listcategory" >'; print'<div class="category-content" ><a href="' . esc_url( get_term_link( $term, $term->taxonomy ) ) . '"><h2>'.$term->name.'</h2></div>'; print'</a>'; print '<div class="category-thumb">' . wp_get_attachment_image( $term->image_id, 'medium' ) . '</div>'; print '<div class="cat-description">'.$term->description.'</div>'; print '</div>'; } print '</div>'; }For more customization look into the README.md in the plugin folder.
Best regards
Forum: Plugins
In reply to: [Taxonomy Images] unable to get taxonomy images for custom post taxonomyHello can you try the following example from the documentation of plugin.
$terms = apply_filters( 'taxonomy-images-get-terms', '', array( 'taxonomy' => 'service', ) ); if ( ! empty( $terms ) ) { print '<div class="container" style="padding-top:50px;">'; foreach ( (array) $terms as $term ) { print'<div class="listcategory" >'; print'<div class="category-content" ><a>taxonomy ) ) . '"><h2>'.$term->name.'</h2></div>'; print'</a>'; print '<div class="category-thumb">' . wp_get_attachment_image( $term->image_id, 'medium' ) . '</div>'; print '<div class="cat-description">'.$term->description.'</div>'; print '</div>'; } print '</div>'; }Best Regards
- This reply was modified 8 years, 5 months ago by ilpert.
Viewing 3 replies - 1 through 3 (of 3 total)