/** * evolve_nice_terms clever terms * * @since 0.2.3 * @needsdoc */ function evolve_nice_terms($term = '', $normal_separator = ', ', $penultimate_separator = ' and ', $end = '') { if (!$term) { return; } switch ($term) { case 'cats': $terms = evolve_get_terms('cats', $normal_separator); break; case 'tags': $terms = evolve_get_terms('tags', $normal_separator); break; } if (empty($term)) { return; } $things = explode($normal_separator, $terms); $thelist = ''; $i = 1; $n = count($things); foreach ($things as $thing) { $data = trim($thing, ' '); $links = preg_match('/>(.*?)</', $thing, $link); $hrefs = preg_match('/href="(.*?)"/', $thing, $href); $titles = preg_match('/title="(.*?)"/', $thing, $title); $rels = preg_match('/rel="(.*?)"/', $thing, $rel); if (1 < $i and $i != $n) { $thelist .= $normal_separator; } if (1 < $i and $i == $n) { $thelist .= $penultimate_separator; } $thelist .= '<a rel="' . $rel[1] . '" href="' . $href[1] . '"'; if (!($term = 'tags')) { $thelist .= ' title="' . $title[1] . '"'; } $thelist .= '>' . $link[1] . '</a>'; $i++; } $thelist .= $end; return apply_filters('evolve_nice_terms', (string) $thelist); }
<?php if (evolve_get_terms('cats')) { ?> <div class="entry-categories"> <?php echo evolve_get_terms('cats'); ?> </div> <?php } ?> <?php if (evolve_get_terms('tags')) { ?> <div class="entry-tags"> <?php echo evolve_get_terms('tags'); ?> </div> <?php } ?> </div> <div class="col-md-6"> <?php if ($evolve_share_this == "single_archive" || $evolve_share_this == "all") { evolve_sharethis(); } else { ?> <div class="margin-40"></div> <?php