本文整理汇总了PHP中theme::time方法的典型用法代码示例。如果您正苦于以下问题:PHP theme::time方法的具体用法?PHP theme::time怎么用?PHP theme::time使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类theme
的用法示例。
在下文中一共展示了theme::time方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_the_breadcrumb
/**
* [UNFINISHED] Generates a breadcrumb or the current page.
*
* @return string The breadcrumb HTML
*/
function get_the_breadcrumb()
{
global $post;
$str = '<ul id="breadcrumbs">';
if (!is_home()) {
$str .= sprintf('<li><a href="%1$s">Home</a></li><li class="separator"> / </li>', home_url('/'));
if (is_category() || is_single()) {
$categories = get_the_category();
if ($categories) {
$cats = array();
foreach (array_slice($categories, 0, 3) as $category) {
$cats[] = sprintf('<li><a href="%1$s">%2$s</a></li>', get_category_link($category->term_id), $category->cat_name);
}
$str .= implode('<li class="separator"> / </li>', $cats);
}
if (is_single()) {
$str .= '<li class="separator"> / </li><li>' . get_the_title() . '</li>';
}
} elseif (is_page()) {
if ($post->post_parent) {
$anc = get_post_ancestors($post->ID);
$title = get_the_title();
foreach ($anc as $ancestor) {
$output = '<li><a href="' . get_permalink($ancestor) . '" title="' . get_the_title($ancestor) . '">' . get_the_title($ancestor) . '</a></li> <li class="separator">/</li>';
}
$str .= $output;
$str .= '<strong title="' . $title . '
"> ' . $title . '</strong>';
} else {
$str .= '<li><strong> ' . get_the_title() . '</strong></li>';
}
}
} elseif (is_tag()) {
single_tag_title();
} elseif (is_day()) {
$str .= "<li>Archive for ";
theme::time('F jS, Y');
$str .= '</li>';
} elseif (is_month()) {
$str .= "<li>Archive for ";
theme::time('F, Y');
$str .= '</li>';
} elseif (is_year()) {
$str .= "<li>Archive for ";
theme::time('Y');
$str .= '</li>';
} elseif (is_author()) {
$str .= "<li>Author Archive";
$str .= '</li>';
} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
$str .= "<li>Blog Archives";
$str .= '</li>';
} elseif (is_search()) {
$str .= "<li>Search Results";
$str .= '</li>';
}
$str .= '</ul>';
}
示例2: printf
printf('<a href="%2$s" class="fn author-with-link" itemprop="name" title="%3$s" rel="nofollow author external">%1$s</a>', $author, esc_url($author_url), esc_attr(sprintf(__("Visit %s’s website", theme::$text_domain), $author)));
} else {
printf('<span class="fn author-no-link" itemprop="name">%1$s</span>', $author);
}
?>
</span>
on
<time class="updated" datetime="<?php
theme::time('m-d-Y H:i');
?>
" itemprop="datePublished" content="<?php
theme::time('c');
?>
">
<?php
theme::time();
?>
</time>
</div>
</div>
</article>
<?php
if (is_singular()) {
if (comments_open() || '0' != get_comments_number()) {
comments_template();
}
}
}
?>
<?php