New answers tagged

0

Ahh ha! Have figured out how to do this. Here's the code for future people who are looking for the same thing: function get_category_tags($args) { global $wpdb; $tags = $wpdb->get_results(" SELECT DISTINCT terms2.term_id as tag_id, terms2.name as tag_name, terms2.slug as tag_slug, null as tag_link FROM wp_posts as p1 ...


0

function product_terms_by_cat() { $terms = get_terms ( array ( 'taxonomy' => 'product_category', 'hide_empty' => false) ); foreach ( $terms as $term ) { echo $term->name; } } add_shortcode('product_terms_by_cat', 'product_terms_by_cat');


1

Try to add the following code in functions.php of your theme and it should do the job. function dcg_tidy_rss_categories( $the_list ) { $categories = get_the_category(); $tags = get_the_tags(); if ( ! empty( $categories ) ) { foreach ($categories as $category) { // remove the following line if you don't want Categories to ...


0

/****post-tag****/ function asr_tags() { $asrtags = get_the_tags(); foreach($asrtags as $tag){ $string .= '<span class="post-tag"><a class="p-tag" href="'. get_tag_link($tag->term_id) .'">'. $tag->name . '</a></span>' . "\n" ; } return $string; } add_shortcode('asrtags' , 'asr_tags' ); /*****post-...


0

Assuming the $value actually returns a post's ID. Replace the code wp_add_post_tags( $post_id, $value ); With wp_add_post_tags( $post_id, sanitize_title( get_the_title( $value[0] ) ) );


Top 50 recent answers are included