elbego
Forum Replies Created
-
Tell me about it!
Michael – if you’re out there I’ll buy you a virtual beer – just please fix the child_of !
Forum: Plugins
In reply to: [Taxonomy Images] [Plugin: Taxonomy Images] get child category imageSame problem here – using custom tax – this shows child terms but with no images…
HELP PLEASE!
ta:$current_term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); $args = array( 'taxonomy' => $current_term->taxonomy, 'child_of' => $current_term->term_id, 'hide_empty' => false, 'title_li' => '', 'term_args' => array( 'orderby' => 'id', 'order' => 'ASC', 'hierarchical' => true, 'depth' => 3, ), ); $cats = wp_list_categories ( $args ); foreach ($cats as $cat) { echo '<li><a href="' . get_category_link($cat) . '" title="'. $cat->name .'">' ; $terms = apply_filters( 'taxonomy-images-get-terms', '' ); if ( ! empty( $terms ) ) { foreach( (array) $terms as $term ) { if($term->term_id == $cat->term_id) { echo wp_get_attachment_image( $term->image_id, 'detail' ); } } } echo $cat->name ; echo '</a></li>'; }Forum: Fixing WordPress
In reply to: Adding custom images to RSS feedDefinitely plugins out there – Google it my friend!
Forum: Fixing WordPress
In reply to: Adding custom images to RSS feedcan you use the arg:
‘feed_image’ => ‘yoursite/images/your110x110image.jpg ‘,
Equally, this produces the correct result albeit without any images!
$current_term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); $cats = wp_list_categories( array( 'child_of' => $current_term->term_id, 'taxonomy' => $current_term->taxonomy, 'hide_empty' => 0, 'hierarchical' => false, 'depth' => 2, 'title_li' => '' )); foreach ((array)$cats as $cat) { $catdesc = $cat->category_description; echo '<li><a href="'. get_category_link($cat).'" title="'. $cat->cat_name .'">'. wp_get_attachment_image( $cat->image_id, 'detail' ) . $cat->cat_name . '</a></li>'; }Sorry – have removed the duplicated code.
$current_term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); $args = array( 'taxonomy' => $current_term->taxonomy, 'child_of' => $current_term->term_id, 'term_args' => array( 'orderby' => 'id', 'order' => 'ASC', 'hierarchical' => 0, ), ); $cats = apply_filters( 'taxonomy-images-get-terms', '', $args ); foreach ($cats as $cat) { echo '<li><a href="' . get_category_link($cat) . '" title="'. $cat->name .'">' ; echo wp_get_attachment_image( $cat->image_id, 'detail' ); echo $cat->name ; echo '</a></li>'; }To update – I had to remove
$le_id = the_ID();From the beginning as it was outputting the page ID as text at the top of the page
It doesn’t seem to matter not using it!?
Cheers
A pleasure to resolve it – I just need to make sure I learn from this…
Thanks again
You’ve absolutely nailed it!
Thanks so much for this – I was at melting point.
You are indeed a gent..
You’ll have to forgive me but I have no idea how to do that!
Doesn’t seem to work. I thought I’d check that the categories are linked correctly, here are the links to and example category from each CPT:
category 1 (testimonials):
taxonomy=testimonials&tag_ID=4&post_type=testimonialcategory 1: (products):
taxonomy=productranges&tag_ID=4&post_type=fw_productBoth have ID4 so should work there?
Could the issue be that it’s on a product page that I’m wanting the output to appear at the end of the main content?
Page code (your code at bottom:
[Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]
forgive my ignorance but please can you show how you integrate the get_posts output following?
Many thanks for your time.