golamrobbani
11/27/2018 - 12:08 PM

get terms remove first element

get terms remove first element

<?php
						$tags = get_the_terms(get_the_ID(), 'post_tag');
						if (!empty($tags)) {
						$category  = wp_list_pluck($tags, 'term_id');
						array_shift($category);
						$count     = count($category);
						$i         = 0;
						$term_list = '<p class="article-tags">';
						foreach ($category as $value) {
							$tag = get_tag($value);
							$i++;
							$term_list .= '<a href="' .  get_tag_link($value) . '">'
								. $tag->name . '</a>';
							if ($count != $i) {
								$term_list .= ' &comma; ';
							} else {
								$term_list .= '</p>';
							}
						 }
							echo $term_list;
						}
						?>