wp_set_object_terms not accepting variable array

Ok, so it turned out that my array was an array of strings somehow, which using var_dump (instead of print_r) revealed. Then I needed to convert my array to int values, which I did thus: $myissuearrayINT = array_map(‘intval’, $myissuearray); And now, when I do the following it works as expected: wp_set_object_terms( $myID, $myissuearrayINT, ‘my_issues’, true … Read more

Get taxonomy url, name, post count & image

Don´t know how this plugin works in detail but i would try this: <?php $taxonomy = ‘channel’; $tax_terms = get_terms($taxonomy); ?> <ul> <?php foreach ($tax_terms as $tax_term) { ?> <li> <?php echo esc_attr(get_term_link($tax_term, $taxonomy)); ?> <?php echo $tax_term->name; ?> <?php echo $tax_term->count; ?> <?php print apply_filters( ‘taxonomy-images-queried-term-image’, ” ); ?> </li> <?php } ?> </ul>

Displaying subcategories and then posts in taxonomy template

Please try this <?php $term = get_queried_object(); $term_id = $term->term_id; $taxonomy_name = $term->taxonomy; $termchildren = get_term_children( $term_id, $taxonomy_name );?> <?php foreach ( $termchildren as $child ) { $term = get_term_by( ‘id’, $child, $taxonomy_name ); ?> <li> <?php echo $term->name; ?> <?php echo $term->description; ?> </li> <?php } if ( have_posts() ) : /* Start the … Read more

how do you get one specific term from a shortcode attribute?

It seems like you are trying to get a term by it’s slug or name. get_term() will get all the term’s data by it’s id. In this case, use get_term_by() instead: function product_category_button($atts) { extract(shortcode_atts(array( ‘category’ => ”, ), $atts)); // if( $category ) : // Vars $taxonomy = ‘product_categories’; // Use ‘name’ instead of … Read more