本文整理汇总了PHP中get_the_modified_time函数的典型用法代码示例。如果您正苦于以下问题:PHP get_the_modified_time函数的具体用法?PHP get_the_modified_time怎么用?PHP get_the_modified_time使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_the_modified_time函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: square_posted_on
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function square_posted_on()
{
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if (get_the_time('U') !== get_the_modified_time('U')) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
}
$time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
$posted_on = sprintf(esc_html_x('%s', 'post date', 'square'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>');
$byline = sprintf(esc_html_x('by %s', 'post author', 'square'), '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>');
$comment_count = get_comments_number();
// get_comments_number returns only a numeric value
if (comments_open()) {
if ($comment_count == 0) {
$comments = __('No Comments', 'square');
} elseif ($comment_count > 1) {
$comments = $comment_count . __(' Comments', 'square');
} else {
$comments = __('1 Comment', 'square');
}
$comment_link = '<a href="' . get_comments_link() . '">' . $comments . '</a>';
} else {
$comment_link = __(' Comment Closed', 'square');
}
echo '<span class="posted-on"><i class="fa fa-clock-o"></i>' . $posted_on . '</span><span class="byline"> ' . $byline . '</span><span class="comment-count"><i class="fa fa-comments-o"></i>' . $comment_link . "</span>";
// WPCS: XSS OK.
}
开发者ID:jgcopple,项目名称:drgaryschwantz,代码行数:29,代码来源:template-tags.php
示例2: ocin_lite_metadata
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function ocin_lite_metadata()
{
echo '<ul>';
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if (get_the_time('U') !== get_the_modified_time('U')) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
}
$time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
echo '<li class="meta_date">' . $time_string . '</li>';
$byline = sprintf(esc_html_x('by %s', 'post author', 'ocin-lite'), '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>');
echo '<li class="meta_comments">' . $byline . '</li>';
if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
echo '<li class="meta_date"><span class="comments-link">';
comments_popup_link(esc_html__('Leave a comment', 'ocin-lite'), esc_html__('1 Comment', 'ocin-lite'), esc_html__('% Comments', 'ocin-lite'));
echo '</span></li>';
}
// Hide category and tag text for pages.
if ('post' === get_post_type() && is_single()) {
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list(esc_html__(', ', 'ocin-lite'));
if ($categories_list && ocin_lite_categorized_blog()) {
printf('<li class="meta_categories"><span class="cat-links">' . esc_html__('Posted in %1$s', 'ocin-lite') . '</span></li>', $categories_list);
// WPCS: XSS OK.
}
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list('', esc_html__(', ', 'ocin-lite'));
if ($tags_list) {
printf('<li class="meta_tags"><span class="tags-links">' . esc_html__('Tagged %1$s', 'ocin-lite') . '</span></li>', $tags_list);
// WPCS: XSS OK.
}
}
echo '</ul>';
}
开发者ID:nicoandrade,项目名称:Ocin-Lite,代码行数:36,代码来源:template-tags.php
示例3: bemmy_posted_on
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function bemmy_posted_on()
{
$byline = sprintf(esc_html_x('%s', 'post author', 'bemmy'), '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>');
$posted_in = '';
// Hide category and tag text for pages.
if ('post' === get_post_type()) {
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list('', esc_html__(', ', 'bemmy'));
if ($tags_list) {
$posted_in .= sprintf(' on <span class="tags-links">' . esc_html__(' %1$s', 'bemmy') . '</span>', $tags_list);
// WPCS: XSS OK.
}
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list(esc_html__(', ', 'bemmy'));
if ($categories_list && bemmy_categorized_blog()) {
$posted_in .= sprintf(' <span class="cat-links">' . esc_html__(' in %1$s', 'bemmy') . '</span>', $categories_list);
// WPCS: XSS OK.
}
}
echo '<span class="artcile__meta-byline"> ' . $byline . '</span><span class="article__meta-in">' . $posted_in . '</span>';
// WPCS: XSS OK.
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if (get_the_time('U') !== get_the_modified_time('U')) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
}
$time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
$posted_on = sprintf('<span class="sep"> | </span>' . esc_html_x(' %s', 'post date', 'bemmy'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>');
echo $posted_on;
}
开发者ID:gios-asu,项目名称:bemmy-wordpress-theme,代码行数:32,代码来源:Meta.php
示例4: usbasske_posted_on
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function usbasske_posted_on()
{
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if (get_the_time('U') !== get_the_modified_time('U')) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
}
$time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
$posted_on = sprintf(esc_html_x('Posted on %s', 'post date', 'usbasske'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>');
$byline = sprintf(esc_html_x('by %s', 'post author', 'usbasske'), '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>');
// Display the author avatar if the author has a Gravatar
$author_id = get_the_author_meta('ID');
if (usbasske_validate_gravatar($author_id)) {
echo '<div class="meta-content has-avatar">';
echo '<div class="author-avatar">' . get_avatar($author_id) . '</div>';
} else {
echo '<div class="meta-content">';
}
echo '<span class="byline"> ' . $byline . '</span><span class="posted-on">' . $posted_on . '</span>';
// WPCS: XSS OK.
if (!post_password_required() && (comments_open() || get_comments_number())) {
echo '<span class="comments-link">';
comments_popup_link(esc_html__('Leave a comment', 'usbasske'), esc_html__('1 Comment', 'usbasske'), esc_html__('% Comments', 'usbasske'));
echo '</span>';
}
echo '</div><!-- .meta-content -->';
}
开发者ID:basskee,项目名称:bd-theme,代码行数:29,代码来源:template-tags.php
示例5: shapely_posted_on_no_cat
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function shapely_posted_on_no_cat()
{
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if (get_the_time('U') !== get_the_modified_time('U')) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
}
$time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
?>
<ul class="post-meta">
<li><span class="posted-on"><?php
echo $time_string;
?>
</span></li>
<li><span><?php
echo esc_html__('by', 'shapely');
?>
<a
href="<?php
echo esc_url(get_author_posts_url(get_the_author_meta('ID')));
?>
"
title="<?php
echo esc_attr(get_the_author());
?>
"><?php
esc_html(the_author());
?>
</a></span>
</li>
</ul><?php
}
开发者ID:puikinsh,项目名称:shapely,代码行数:35,代码来源:template-tags.php
示例6: pleiadesweb_posted_on
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function pleiadesweb_posted_on()
{
// POSTED ON
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if (get_the_time('U') !== get_the_modified_time('U')) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
}
$time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
$posted_on = sprintf('<i class="fa fa-calendar"></i>' . esc_html_x(' %s', 'post date', 'pleiadesweb'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>');
// AUTHOR
$byline = sprintf(esc_html_x('| escrito por %s', 'post author', 'pleiadesweb'), '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>');
echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>';
// CATEGORIES
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list(esc_html__(', ', 'pleiadesweb'));
if ($categories_list && pleiadesweb_categorized_blog()) {
echo ' | </i><span class="category-list">' . $categories_list . '</span>';
}
// COMMENTS
if (!post_password_required() && (comments_open() || '0' != get_comments_number())) {
echo ' | <span class="comments-link">';
comments_popup_link(__('Deja un comentario', 'my-simone'), __('1 comentario', 'my-simone'), __('% comentarios', 'my-simone'));
echo '</span>';
}
//!post_password_required()
}
开发者ID:pleiadesdigital,项目名称:pleiadesweb,代码行数:29,代码来源:template-tags.php
示例7: river_radio_posted_on
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function river_radio_posted_on()
{
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if (get_the_time('U') !== get_the_modified_time('U')) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
}
$time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
$posted_on = sprintf(esc_html_x('%s', 'post date', 'river-radio'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>');
$byline = sprintf(esc_html_x('%s', 'post author', 'river-radio'), '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>');
echo '<span class="byline icons"><i class="fa fa-headphones"></i>
' . $byline . '</span><span class="posted-on icons"><i class="fa fa-calendar"></i>
' . $posted_on . '</span>';
// WPCS: XSS OK.
if ('post' === get_post_type()) {
$tags_list = get_the_tag_list('', esc_html__(', ', 'river-radio'));
if ($tags_list) {
printf('<span class="tags-links icons"><i class="fa fa-music"></i>
' . esc_html__('%1$s', 'river-radio') . '</span> ', $tags_list);
// WPCS: XSS OK.
}
$categories_list = get_the_category_list(esc_html__(', ', 'river-radio'));
if ($categories_list && river_radio_categorized_blog()) {
printf('<span class="cat-links icons"><i class="fa fa-map-marker"></i>
' . esc_html__('%1$s', 'river-radio') . '</span>', $categories_list);
// WPCS: XSS OK.
}
}
}
开发者ID:AndyA,项目名称:River,代码行数:31,代码来源:template-tags.php
示例8: material_design_par_amauri_posted_on
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function material_design_par_amauri_posted_on()
{
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if (get_the_time('U') !== get_the_modified_time('U')) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
}
$time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
$posted_on = sprintf(esc_html__('Posted on %s', 'material-design-par-amauri'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>');
$byline = sprintf(esc_html__('by %s', 'material-design-par-amauri'), '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>');
if (is_singular()) {
echo '<img width="36" height="36" src="' . esc_url(get_template_directory_uri() . '/image/icon/_' . get_post_format() . '.png') . '" alt="' . get_post_format() . '" /> ';
}
echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span> ';
if ('post' == get_post_type()) {
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list(esc_html__(', ', 'material-design-par-amauri'));
if ($categories_list && material_design_par_amauri_categorized_blog()) {
printf('<span class="cat-links">' . esc_html__('in %1$s', 'material-design-par-amauri') . '</span>', $categories_list);
// WPCS: XSS OK.
}
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list('', esc_html__(', ', 'material-design-par-amauri'));
if ($tags_list) {
printf('<span class="tags-links">' . esc_html__(', tagged: %1$s', 'material-design-par-amauri') . '</span>', $tags_list);
// WPCS: XSS OK.
}
}
}
开发者ID:henlz,项目名称:WCode-WebSite,代码行数:31,代码来源:template-tags.php
示例9: jkl_index_posted_on
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function jkl_index_posted_on()
{
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if (get_the_time('U') !== get_the_modified_time('U')) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
}
$time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
$byline = sprintf(esc_html('%s'), '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">@' . esc_html(get_the_author()) . '</a></span>');
if ('chat' === get_post_format() || 'image' === get_post_format() || 'gallery' === get_post_format() || 'audio' === get_post_format() || 'video' === get_post_format()) {
$string = ucwords(get_post_format());
$posted_on = $string . ': <a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>';
} else {
$posted_on = sprintf(esc_html_x('Date: %s', 'post date', 'jkl'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>');
}
$meta_class = is_single() ? 'format-small-meta' : 'meta-content-index';
echo '<div class="' . $meta_class . '">';
echo '<span class="posted-on">' . $posted_on . '</span>';
// WPCS: XSS OK.
if (is_single()) {
echo '<span class="byline">' . $byline . '</span>';
if (!has_post_format('quote')) {
jkl_better_taxonomy_listing('category', 1);
}
}
echo '</div><!-- .meta-content-index -->';
}
开发者ID:jekkilekki,项目名称:theme-jkl,代码行数:29,代码来源:template-tags.php
示例10: tm_vals_blog_posted_on
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function tm_vals_blog_posted_on()
{
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if (get_the_time('U') !== get_the_modified_time('U')) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
}
$time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
// comments in header
if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
echo '<span class="comments-link">';
comments_popup_link(esc_html__('Leave a comment', 'tm-vals-blog'), esc_html__('1', 'tm-vals-blog'), esc_html__('%', 'tm-vals-blog'));
echo '</span>';
}
/* $posted_on = sprintf(
esc_html_x( 'Posted on %s', 'post date', 'tm-vals-blog' ),
'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
);
$byline = sprintf(
esc_html_x( 'by %s', 'post author', 'tm-vals-blog' ),
'<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>'
);
echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>'; // WPCS: XSS OK.
*/
}
开发者ID:vfedushchin,项目名称:Tm-kursi-theme,代码行数:29,代码来源:template-tags.php
示例11: kanec_entry_meta
/**
* This is a duplicate of the above. Probably delete others
*/
function kanec_entry_meta()
{
// Time
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if (get_the_time('U') !== get_the_modified_time('U')) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
}
$time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
echo '<div class="posted-on"><i class="icon icon-calendar-o"></i><a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a></div>';
// Author
echo '<div class="byline"><i class="icon icon-user"></i><span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span></div>';
// Categories & Tags
// Hide category and tag text for pages.
if ('post' === get_post_type()) {
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list(esc_html__(', ', 'kanec'));
if ($categories_list && kanec_categorized_blog()) {
echo '<div class="cat-links"><i class="icon icon-folder-open"></i>' . $categories_list . '</div>';
}
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list('', esc_html__(', ', 'kanec'));
if ($tags_list) {
echo '<div class="tags-links"><i class="icon icon-tags"></i>' . $tags_list . '</div>';
}
}
if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
echo '<div class="comments-link"><i class="icon icon-comments"></i>';
comments_popup_link(esc_html__('Leave a comment', 'kanec'), esc_html__('1 Comment', 'kanec'), esc_html__('% Comments', 'kanec'));
echo '</div>';
}
}
开发者ID:vonkanehoffen,项目名称:kanec-wp-theme,代码行数:34,代码来源:template-tags.php
示例12: gd_post_meta
function gd_post_meta()
{
$output = '<div class="entry-meta">';
//~ 字体设置按钮
if (is_single() || is_page()) {
$output .= apply_filters('dmeng_post_meta_set_font', '<div class="entry-set-font"><span id="set-font-small" class="disabled">A<sup>-</sup></span><span id="set-font-big">A<sup>+</sup></span></div>');
}
// $output .= apply_filters('dmeng_post_meta_author', '<span class="glyphicon glyphicon-user"></span><a href="'.esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ).'" itemprop="author">'.get_the_author().'</a>');
$output .= apply_filters('dmeng_post_meta_date', '<span class="glyphicon glyphicon-calendar"></span><time class="entry-date" title="' . sprintf(__('发布于 %1$s 最后编辑于 %2$s ', 'dmeng'), get_the_time('Y-m-d H:i:s'), get_the_modified_time('Y-m-d H:i:s')) . '" datetime="' . get_the_date('c') . '" itemprop="datePublished">' . get_the_date() . '</time>');
// $output .= apply_filters('dmeng_post_meta_comments_number', '<span class="glyphicon glyphicon-comment"></span><a href="'.get_permalink().'#comments" itemprop="discussionUrl" itemscope itemtype="http://schema.org/Comment"><span itemprop="interactionCount">'.get_comments_number().'</span></a>');
$traffic = get_dmeng_traffic('single', get_the_ID());
$output .= apply_filters('dmeng_post_meta_traffic', '<span class="glyphicon glyphicon-eye-open"></span>' . sprintf(__('%s 次浏览', 'dmeng'), is_singular() ? '<span data-num-views="true">' . $traffic . '</span>' : $traffic));
//~ 如果是文章页则输出分类和标签,因为只有文章才有~
if (get_post_type() == 'post') {
if (apply_filters('dmeng_post_meta_cat_show', true)) {
$categories = get_the_category();
if ($categories) {
foreach ($categories as $category) {
$cats[] = '<a href="' . get_category_link($category->term_id) . '" rel="category" itemprop="articleSection">' . $category->name . '</a>';
}
$output .= apply_filters('dmeng_post_meta_cat', '<span class="glyphicon glyphicon-folder-open"></span>' . join(' | ', $cats));
}
}
if (apply_filters('dmeng_post_meta_tag_show', true)) {
$tags = get_the_tag_list('<span class="glyphicon glyphicon-tags"></span>', ' | ');
if ($tags) {
$output .= apply_filters('dmeng_post_meta_tag', '<span itemprop="keywords">' . $tags . '</span>');
}
}
}
$output .= '</div>';
echo $output;
}
开发者ID:jixingyu,项目名称:gdmusik,代码行数:33,代码来源:functions.php
示例13: generate_posted_on
function generate_posted_on()
{
if ('post' !== get_post_type()) {
return;
}
$date = apply_filters('generate_post_date', true);
$author = apply_filters('generate_post_author', true);
$time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">%2$s</time>';
if (get_the_time('U') !== get_the_modified_time('U')) {
$time_string .= '<time class="updated" datetime="%3$s" itemprop="dateModified">%4$s</time>';
}
$time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
// If our date is enabled, show it
if ($date) {
printf('<span class="posted-on">%1$s</span>', sprintf('<a href="%1$s" title="%2$s" rel="bookmark">%3$s</a>', esc_url(get_permalink()), esc_attr(get_the_time()), $time_string));
}
// If our author is enabled, show it
if ($author) {
printf(' <span class="byline">%1$s</span>', sprintf('<span class="author vcard" itemtype="http://schema.org/Person" itemscope="itemscope" itemprop="author">%1$s <a class="url fn n" href="%2$s" title="%3$s" rel="author" itemprop="url"><span class="author-name" itemprop="name">%4$s</span></a></span>', __('by', 'generate'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'generate'), get_the_author())), esc_html(get_the_author())));
}
// If comments enabled link to them
if (comments_open() && is_single()) {
echo '<span class="comments-link"><a href="#reply-title">Add a comment</a></span>';
}
}
开发者ID:leonp,项目名称:generate-child,代码行数:25,代码来源:functions.php
示例14: ushipnetwork_posted_on
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function ushipnetwork_posted_on()
{
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if (get_the_time('U') !== get_the_modified_time('U')) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>';
}
$time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()));
$posted_on = sprintf(esc_html_x('%s', 'post date', 'ushipnetwork'), $time_string);
$byline = sprintf(esc_html_x('by %s', 'post author', 'ushipnetwork'), '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>');
echo '<div class="posted-on">' . $posted_on . '<div class="share">';
include "share.php";
echo '</div>' . '</div>';
echo '<div class="byline">' . '<div class="authorship">' . $byline . '</div>';
$posttags = get_the_tags();
$count = 0;
$separator = ', ';
$output = '';
if (!empty($posttags)) {
echo '<span class="tag-list">tags: ';
foreach ($posttags as $posttag) {
$count++;
if ($count <= 2) {
$output .= '<a href="' . esc_url(get_tag_link($posttag->term_id)) . '" alt="' . esc_attr(sprintf(__('View all posts in %s', 'textdomain'), $posttag->name)) . '">' . esc_html($posttag->name) . '</a>' . $separator;
}
}
echo trim($output, $separator);
}
echo '</span>' . '</div>';
}
开发者ID:rmikeska,项目名称:ushipnetwork,代码行数:32,代码来源:template-tags.php
示例15: banana_posted_on
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function banana_posted_on() {
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
}
$time_string = sprintf( $time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() )
);
$posted_on = sprintf(
_x( 'Posted on %s', 'post date', 'banana' ),
'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
);
$byline = sprintf(
_x( 'by %s', 'post author', 'banana' ),
'<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>'
);
echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>';
}
开发者ID:hoffmander,项目名称:banana-theme,代码行数:29,代码来源:template-tags.php
示例16: bhr_append_last_author
function bhr_append_last_author($content)
{
global $post, $pp;
$html = "<div class=\"post-author\">";
$html .= sprintf(__("Last edited by %s on %s at %s", "bhr"), get_the_modified_author(), get_the_modified_date(), get_the_modified_time());
$html .= "</div>";
return $content . $html;
}
开发者ID:khamer71,项目名称:blueheronsresistance.com,代码行数:8,代码来源:functions.php
示例17: hybrid_meta_revised
/**
* Add the revised meta tag on single posts and pages (or any post type). This shows the last time the post
* was modified.
*
* @since 0.4.0
*/
function hybrid_meta_revised() {
$revised = '';
if ( is_singular() )
$revised = '<meta name="revised" content="' . get_the_modified_time( esc_attr__( 'l, F jS, Y, g:i a', hybrid_get_textdomain() ) ) . '" />' . "\n";
echo apply_atomic( 'meta_revised', $revised );
}
开发者ID:nerdfiles,项目名称:mabrylaw.com,代码行数:14,代码来源:core-seo.php
示例18: get_hatom_data_page
function get_hatom_data_page()
{
$html = '<div class="hatom-extra" style="display:none;visibility:hidden;">';
$html .= '<span class="entry-title">' . get_the_title() . '</span>';
$html .= '<span class="updated"> ' . get_the_modified_time('F jS, Y') . '</span>';
$html .= '<span class="author vcard"><span class="fn">' . get_the_author() . '</span></span></div>';
return $html;
}
开发者ID:collinbarrett,项目名称:collinmbarrett,代码行数:8,代码来源:functions.php
示例19: mythology_posted_on
function mythology_posted_on()
{
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>';
if (get_the_time('U') !== get_the_modified_time('U')) {
$time_string = '<time class="updated" datetime="%3$s">%4$s</time>';
}
$time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
printf(__('<span class="posted-on">Posted on %1$s</span><span class="byline"> by %2$s</span>', 'mythology'), sprintf('<a href="%1$s" rel="bookmark">%2$s</a>', esc_url(get_permalink()), $time_string), sprintf('<span class="author vcard"><a class="url fn n" href="%1$s">%2$s</a></span>', esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_html(get_the_author())));
}
开发者ID:estrategasdigitales,项目名称:Golone,代码行数:9,代码来源:mythology-core-functions.php
示例20: zerif_posted_on
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function zerif_posted_on()
{
$time_string = '<time class="entry-date published" itemprop="datePublished" datetime="%1$s">%2$s</time>';
if (get_the_time('U') !== get_the_modified_time('U')) {
$time_string .= '<time class="updated" datetime="%3$s">%4$s</time>';
}
$time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
printf(__('<span class="posted-on">Posted on %1$s</span><span class="byline"> by %2$s</span>', 'zerif'), sprintf('<a href="%1$s" rel="bookmark">%2$s</a>', esc_url(get_day_link(get_the_date('Y'), get_the_date('m'), get_the_date('d'))), $time_string), sprintf('<span class="author vcard" itemprop="name"><a href="%1$s" class="url fn n author-link" itemscope="itemscope" itemtype="http://schema.org/Person" itemprop="author">%2$s</a></span>', esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_html(get_the_author())));
}
开发者ID:akshayxhtmljunkies,项目名称:brownglock,代码行数:12,代码来源:template-tags.php
注:本文中的get_the_modified_time函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿 |
请发表评论