コード例 #1
0
/**
 * framework_nice_terms clever terms
 *
 * @since 0.2.3
 * @needsdoc
 */
function framework_nice_terms($term = '', $normal_separator = ', ', $penultimate_separator = ' and ', $end = '')
{
    if (!$term) {
        return;
    }
    switch ($term) {
        case 'cats':
            $terms = framework_get_terms('cats', $normal_separator);
            break;
        case 'tags':
            $terms = framework_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('framework_nice_terms', (string) $thelist);
}
コード例 #2
0
ファイル: index.php プロジェクト: sandesh247/sandesh247.com
        ?>
					<!--END .entry-content .article-->
					</div>

					<!--BEGIN .entry-meta .entry-footer-->
                    <div class="entry-meta entry-footer">
                    	<span class="entry-categories">Posted in <?php 
        echo framework_get_terms('cats');
        ?>
</span>
						<?php 
        if (framework_get_terms('tags')) {
            ?>
                        <span class="meta-sep">|</span>
                        <span class="entry-tags">Tagged <?php 
            echo framework_get_terms('tags');
            ?>
</span>
                        <?php 
        }
        ?>
					<!--END .entry-meta .entry-footer-->
                    </div>
				<!--END .hentry-->
				</div>

				<?php 
    }
    ?>
				<?php 
    include TEMPLATEPATH . '/navigation.php';