本文整理汇总了PHP中the_time函数的典型用法代码示例。如果您正苦于以下问题:PHP the_time函数的具体用法?PHP the_time怎么用?PHP the_time使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了the_time函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: shaped_blog_posted_on
function shaped_blog_posted_on()
{
?>
<ul class="list-inline">
<li>
<span class="author vcard">
<?php
_e('By ', 'shaped-blog');
printf('<a class="url fn n" href="%1$s">%2$s</a>', esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_html(get_the_author()));
?>
</span>
</li>
<li>
on <span class="posted-on"><?php
the_time('M d, Y');
?>
</span>
</li>
<?php
if (get_the_category_list()) {
?>
<li>
in <span class="posted-in">
<?php
echo get_the_category_list(_x(', ', 'Used between list items, there is a space after the comma.', 'shaped-blog'));
?>
</span>
</li>
<?php
}
?>
</ul>
<?php
}
示例2: widget
function widget($args, $instance)
{
extract($args);
@($title = $instance['title'] ? $instance['title'] : '最热文章');
@($num = $instance['num'] ? $instance['num'] : 5);
echo $before_widget;
?>
<div class="panel panel-zan hidden-xs">
<div class="panel-heading"><?php
echo $title;
?>
</div>
<div class="panel-body">
<ul class="list-group">
<?php
// 设置全局变量,实现post整体赋值
global $post;
$posts = zan_get_hotest_posts($num);
foreach ($posts as $post) {
setup_postdata($post);
?>
<li class="zan-list clearfix">
<figure class="thumbnail zan-thumb">
<?php
the_post_thumbnail(array(75, 75));
?>
</figure>
<a href="<?php
the_permalink();
?>
">
<h5><?php
the_title();
?>
</h5>
</a>
<div class="sidebar-info">
<span><i class="fa fa-calendar"></i> <?php
the_time('m月j日, Y');
?>
</span>
<span><i class="fa fa-comment"></i> <a href="<?php
the_permalink();
?>
#comments"><?php
comments_number('0', '1', '%');
?>
</a></span>
</div>
</li>
<?php
}
wp_reset_postdata();
?>
</ul>
</div>
</div>
<?php
echo $after_widget;
}
示例3: get_news_ticker
function get_news_ticker($tickercat, $count)
{
global $post;
$args = array('posts_per_page' => $count, 'cat' => $tickercat);
$loop = new WP_Query($args);
echo "<ul>";
while ($loop->have_posts()) {
$loop->the_post();
?>
<li class="ticker-item">
<b><?php
the_time('M j, Y');
?>
</b> - <a href="<?php
the_permalink();
?>
"> <?php
the_title();
?>
</a>
</li>
<?php
}
echo "</ul>";
wp_reset_postdata();
}
示例4: rambo_post_meta_content
function rambo_post_meta_content()
{
?>
<div class="blog_section2_comment">
<a href="<?php
the_permalink();
?>
"><i class="fa fa-calendar icon-spacing"></i><?php
the_time(get_option('date_format'));
?>
</a>
<a href="<?php
the_permalink();
?>
"><i class="fa fa-comments icon-spacing"></i><?php
comments_popup_link(__('leave a comment', 'rambo'));
?>
</a>
<a href="<?php
echo get_author_posts_url(get_the_author_meta('ID'));
?>
"><i class="fa fa-user icon-spacing"></i> <?php
_e("By", 'rambo');
?>
<?php
the_author();
?>
</a>
</div>
<?php
}
示例5: post_excerpts_here
function post_excerpts_here()
{
//posts with date, author, time, content excerpts, and title..
if (have_posts()) {
while (have_posts()) {
echo '<div class="excerpt-div">';
the_post();
echo '<h2 class="post-title"><a href="';
the_permalink();
echo '" title="';
the_title();
echo '">';
the_title();
echo '</a></h2>';
echo '<h4 class="post-info">';
echo 'Created on ';
the_date();
echo ' at ';
the_time();
echo ' by ';
the_author_meta(first_name);
echo '.</h4>';
echo '<p class="post-excerpt">';
the_excerpt();
echo '</p>';
echo '</div>';
}
// end while
}
// end if
}
示例6: webonary_zeedisplay_display_entry_header
/**
* Display common postmeta information. The parent theme originally showed
* date, author, and a comment link.
*/
function webonary_zeedisplay_display_entry_header()
{
$options = get_option('themezee_options');
if (isset($options['themeZee_blog_mode']) and $options['themeZee_blog_mode'] == BLOG_MODE) {
?>
<div class="postmeta">
<span class="date"><a href="<?php
the_permalink();
?>
"><?php
the_time(get_option('date_format'));
?>
</a></span>
<span class="author"><?php
the_author();
?>
</span>
<span class="comment"><a href="<?php
the_permalink();
?>
#comments"><?php
comments_number(__('No comments', ZEE_LANG), __('One comment', ZEE_LANG), __('% comments', ZEE_LANG));
?>
</a></span>
</div>
<?php
}
}
示例7: totomo_posted_on
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function totomo_posted_on()
{
// Default info will be shown
$post_format = get_post_format(get_the_ID());
?>
<ul class="post-meta clearfix">
<li>
<time class="date fa fa-clock-o" datetime="<?php
the_time('c');
?>
" pubdate><?php
the_time(get_option('date_format'));
?>
</time>
</li>
<li>
<?php
comments_popup_link(__('No Comments', 'totomo'), __('1 Comment', 'totomo'), __('% Comments', 'totomo'), 'comments-link fa fa-comments');
?>
</li>
<li class="fa fa-tags">
<?php
the_category(', ');
?>
</li>
</ul>
<?php
}
示例8: categori_news
function categori_news(){
query_posts('cat=9&showposts=10&posts_per_page=3');
while (have_posts()) : the_post();
/*Dima insert*/the_excerpt(); ?>
<div class="content-box">
<div class="bgr01"><div class="bgr02"><div class="bgr03">
<div <?php post_class() ?> id="post-<?php the_ID(); ?>" style=" float:none; ">
<div class="title">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<div class="date_all">
<?php the_time('l, j ?F, Y') ?>
</div>
<div class="post">
Написал <?php the_author_link() ?> <?php the_time('g:i A') ?>
</div>
</div>
<div class="content_box">
<?php the_content('Читать всё'); ?>
</div>
<div class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?></div>
<div class="comments"><?php comments_popup_link('0 комментарии', 'комментарии', '% комментарии '); ?></div>
<div class="link-edit"><?php edit_post_link('Edit', ''); ?></div>
</div>
</div></div></div>
</div>
<?php endwhile;}
示例9: woo_widget_tabs_latest
function woo_widget_tabs_latest($posts = 5, $size = 45)
{
global $post;
$latest = get_posts(array('suppress_filters' => false, 'ignore_sticky_posts' => 1, 'orderby' => 'post_date', 'order' => 'desc', 'numberposts' => $posts));
foreach ($latest as $post) {
setup_postdata($post);
?>
<li>
<?php
if ($size != 0) {
woo_image('height=' . $size . '&width=' . $size . '&class=thumbnail&single=true');
}
?>
<a title="<?php
the_title_attribute();
?>
" href="<?php
the_permalink();
?>
"><?php
the_title();
?>
</a>
<span class="meta"><?php
the_time(get_option('date_format'));
?>
</span>
<div class="fix"></div>
</li>
<?php
}
wp_reset_postdata();
}
示例10: _post
echo "</div>";
}
function _post()
{
?>
<!-- POSTS -->
<div class="post">
<div class="posthead">
<span class="date">
<?php
the_time('d/m/Y');
?>
</span><!-- /date -->
<span class="autor">
<?php
the_author_posts_link();
?>
</span>
<?php
//the_category(" | ")
?>
</div><!-- /headpost -->
<div class="postcontent">
<h1><a href="<?php
the_permalink();
?>
" title="<?php
the_title();
示例11: widget
function widget($args, $instance)
{
extract($args);
$title = apply_filters('widget_title', $instance['title']);
echo $before_widget;
if ($title) {
echo $before_title . $title . $after_title;
}
?>
<ul class="post-list">
<?php
query_posts('post_type=post&posts_per_page=' . $instance['amount'] . '&orderby=comment_count&order=DESC');
if (have_posts()) {
while (have_posts()) {
the_post();
?>
<li>
<figure class="frame pull-left">
<div class="icon-overlay"><a href="<?php
the_permalink();
?>
"><span class="icn-more"></span><?php
the_post_thumbnail('thumbnail');
?>
</a></div>
</figure>
<div class="meta"> <em><span class="date"><?php
the_time(get_option('date_format'));
?>
</span>
<span class="comments"><a href="<?php
comments_link();
?>
"><?php
comments_number('0', '1', '%');
?>
<i class="icon-chat-1"></i></a></span></em>
<h5><a href="<?php
the_permalink();
?>
"><?php
the_title();
?>
</a></h5>
</div>
</li>
<?php
}
}
wp_reset_query();
?>
</ul>
<?php
echo $after_widget;
}
示例12: b_wp_contents_show
function b_wp_contents_show($options)
{
// global $xoopsDB,$xoopsUser;
// global $tableoptions,$tableusers;
// global $id, $posts, $post, $day, $previousday, $newday;
$id = 1;
global $posts, $post, $day, $previousday, $newday;
global $dateformat, $time_difference, $siteurl, $blogfilename;
global $tablelinks, $tablelinkcategories;
global $querystring_start, $querystring_equal, $querystring_separator, $month, $wpdb, $start_of_week;
global $tableposts, $tablepost2cat, $tablecomments, $tablecategories;
global $smilies_directory, $use_smilies, $wp_smiliessearch, $wp_smiliesreplace;
global $wp_bbcode, $use_bbcode, $wp_gmcode, $use_gmcode, $use_htmltrans, $wp_htmltrans, $wp_htmltranswinuni;
require_once dirname(__FILE__) . '/../wp-blog-header.php';
$blog = 1;
$block = array();
$block['siteurl'] = $siteurl;
foreach ($posts as $post) {
$content = array();
start_wp();
$content['date'] = the_date('', '<h2>', '</h2>', false);
$content['time'] = the_time('', false);
$content['title'] = the_title('', '', false);
$content['permlink'] = get_permalink();
//
ob_start();
the_author();
$content['author'] = ob_get_contents();
ob_end_clean();
//
ob_start();
the_category();
$content['category'] = ob_get_contents();
ob_end_clean();
//
ob_start();
the_content();
$content['body'] = ob_get_contents();
ob_end_clean();
//
ob_start();
link_pages('<br />Pages: ', '<br />', 'number');
$content['linkpage'] = ob_get_contents();
ob_end_clean();
//
ob_start();
comments_popup_link('Comments (0)', 'Comments (1)', 'Comments (%)');
$content['comments'] = ob_get_contents();
ob_end_clean();
//
ob_start();
trackback_rdf();
$content['trackback'] = ob_get_contents();
ob_end_clean();
//
$block['contents'][] = $content;
}
return $block;
}
示例13: widget
function widget($args, $instance)
{
extract($args);
$title = apply_filters('widget_title', empty($instance['title']) ? 'Popular This Week' : $instance['title']);
$postsNum = empty($instance['postsNum']) ? '' : (int) $instance['postsNum'];
$show_thisweek = isset($instance['thisweek']) ? (bool) $instance['thisweek'] : false;
echo $before_widget;
if ($title) {
echo $before_title . $title . $after_title;
}
$additional_query = $show_thisweek ? '&year=' . date('Y') . '&w=' . date('W') : '';
query_posts('post_type=post&posts_per_page=' . $postsNum . '&orderby=comment_count&order=DESC' . $additional_query);
?>
<?php
if (have_posts()) {
while (have_posts()) {
the_post();
?>
<div class="blog-entry">
<a href="<?php
the_permalink();
?>
" class="comments"><?php
comments_number('0', '1', '%');
?>
</a>
<h4 class="title"><a href="<?php
the_permalink();
?>
"><?php
the_title();
?>
</a></h4>
<p class="meta-info"><?php
esc_html_e('Posted', 'Aggregate');
?>
<?php
esc_html_e('by', 'Aggregate');
?>
<?php
the_author_posts_link();
?>
<?php
esc_html_e('on', 'Aggregate');
?>
<?php
the_time('n-j-y');
?>
</p>
</div>
<?php
}
}
wp_reset_query();
?>
<?php
echo $after_widget;
}
示例14: widget
/** @see WP_Widget::widget */
function widget($args, $instance)
{
extract($args);
//these are our widget options
$title = $instance['title'];
$count = $instance['count'];
//get recent posts
query_posts(array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $count, 'order' => 'DESC'));
echo $before_widget;
?>
<div class="clearfix">
<div class="header_left">
<?php
if ($title) {
echo $before_title . $title . $after_title;
}
?>
</div>
<div class="header_right">
<a href="#" id="footer_recent_posts_prev" class="scrolling_list_control_left icon_small_arrow left_white"></a>
<a href="#" id="footer_recent_posts_next" class="scrolling_list_control_right icon_small_arrow right_white"></a>
</div>
</div>
<div class="scrolling_list_wrapper">
<ul class="scrolling_list footer_recent_posts">
<?php
if (have_posts()) {
while (have_posts()) {
the_post();
?>
<li class="icon_small_arrow right_white">
<a href="<?php
the_permalink();
?>
" title="<?php
the_title();
?>
">
<?php
the_title();
?>
</a>
<abbr title="<?php
the_time('c');
?>
" class="timeago"><?php
the_time('c');
?>
</abbr>
</li>
<?php
}
}
?>
</ul>
</div>
<?php
echo $after_widget;
}
示例15: bfa_parse_date_callback
function bfa_parse_date_callback($matches)
{
ob_start();
the_time($matches[2]);
$date = ob_get_contents();
ob_end_clean();
return $date;
}