本文整理汇总了PHP中the_author函数的典型用法代码示例。如果您正苦于以下问题:PHP the_author函数的具体用法?PHP the_author怎么用?PHP the_author使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了the_author函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: custom_columns
/**
* Display of Custom Post Type Columns
* @param array $column
* @since 1.0.0
*/
public function custom_columns($column)
{
global $post;
switch ($column) {
case 'title':
the_title();
break;
case 'author':
the_author();
break;
case 'cat':
echo get_the_term_list($post->ID, 'docu_cat', ' ', ', ', '');
break;
case 'tag':
echo get_the_term_list($post->ID, 'docu_tag', ' ', ', ', '');
break;
case 'comment':
comments_number(__('No Comments', 'documentate'), __('1 Comment', 'documentate'), __('% Comments', 'documentate'));
break;
case 'views':
$views = get_post_meta($post->ID, 'documentate_post_views_count', true);
if ($views) {
printf(_n('%s view', '%s views', $rating, 'documentate'), $views);
} else {
echo __('No Views', 'documentate');
}
break;
case 'date':
the_date();
break;
}
}
示例2: kbe_custom_columns
function kbe_custom_columns($column)
{
global $post;
switch ($column) {
case "title":
the_title();
break;
case "author":
the_author();
break;
case "cat":
echo get_the_term_list($post->ID, 'kbe_taxonomy', ' ', ', ', '');
break;
case "tag":
echo get_the_term_list($post->ID, 'kbe_tags', ' ', ', ', '');
break;
case "comment":
comments_number(__('No Comments', 'kbe'), __('1 Comment', 'kbe'), __('% Comments', 'kbe'));
break;
case "views":
$views = get_post_meta($post->ID, 'kbe_post_views_count', true);
if ($views) {
echo $views . __(' Views', 'kbe');
} else {
echo __('No Views', 'kbe');
}
break;
case "date":
the_date();
break;
}
}
示例3: 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
}
}
示例4: 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
}
示例5: 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
}
示例6: draw_commit_listing
/**
* Generates an individual listing for a commit object
*
* @param $commit - The commit object to display
*/
public static function draw_commit_listing($commit)
{
?>
<div>
<div>
<strong>
<a href="<?php
echo admin_url('/edit.php?post_type=acf-commit');
?>
">
<?php
echo get_the_date('M d, Y H:i a', $commit->ID);
?>
</a>
</strong>
</div>
<div><em><?php
echo get_field('commit_message', $commit->ID);
?>
</em></div>
<div>Author: <?php
the_author();
?>
</div>
<hr/>
</div>
<?php
}
示例7: cpotheme_page_title
function cpotheme_page_title()
{
global $post;
if (isset($post->ID)) {
$current_id = $post->ID;
} else {
$current_id = false;
}
$title_tag = function_exists('is_woocommerce') && is_woocommerce() && is_singular('product') ? 'span' : 'h1';
echo '<' . $title_tag . ' class="pagetitle-title heading">';
if (function_exists('is_woocommerce') && is_woocommerce()) {
woocommerce_page_title();
} elseif (is_category() || is_tag() || is_tax()) {
echo single_tag_title('', true);
} elseif (is_author()) {
the_author();
} elseif (is_date()) {
_e('Archive', 'brilliance');
} elseif (is_404()) {
echo __('Page Not Found', 'brilliance');
} elseif (is_search()) {
echo __('Search Results for', 'brilliance') . ' "' . get_search_query() . '"';
} else {
echo get_the_title($current_id);
}
echo '</' . $title_tag . '>';
}
示例8: ro_theme_author_render
function ro_theme_author_render()
{
ob_start();
?>
<?php
if (is_sticky() && is_home() && !is_paged()) {
?>
<span class="featured-post"> <?php
_e('Sticky', 'robusta');
?>
</span>
<?php
}
?>
<div class="ro-about-author clearfix">
<div class="ro-author-avatar"><?php
echo get_avatar(get_the_author_meta('ID'), 170);
?>
</div>
<div class="ro-author-info">
<h6 class="ro-name"><?php
the_author();
?>
</h6>
<?php
the_author_meta('description');
?>
</div>
</div>
<?php
return ob_get_clean();
}
示例9: php_exec_process
function php_exec_process($phpexec_text)
{
$phpexec_userdata = get_userdatabylogin(the_author('login', false));
if ($phpexec_userdata->user_level >= php_exec_getuserlevel()) {
$phpexec_doeval = true;
}
$phpexec_textarr = preg_split("/(<phpcode>.*<\\/phpcode>)/Us", $phpexec_text, -1, PREG_SPLIT_DELIM_CAPTURE);
// capture the tags as well as in between
$phpexec_stop = count($phpexec_textarr);
// loop stuff
for ($phpexec_i = 0; $phpexec_i < $phpexec_stop; $phpexec_i++) {
$phpexec_content = $phpexec_textarr[$phpexec_i];
if (preg_match("/^<phpcode>(.*)<\\/phpcode>/Us", $phpexec_content, $phpexec_code)) {
// If it's a phpcode
$phpexec_php = $phpexec_code[1];
if ($phpexec_doeval) {
ob_start();
eval("?>" . $phpexec_php . "<?php ");
$phpexec_output .= ob_get_clean();
} else {
$phpexec_output .= htmlspecialchars($phpexec_php);
}
} else {
$phpexec_output .= $phpexec_content;
}
}
return $phpexec_output;
}
示例10: 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;
}
示例11: widget
function widget($args, $instance)
{
extract($args);
//$options = get_option('custom_recent');
$title = $instance['title'];
$postscount = $instance['posts'];
//GET the posts
global $postcount;
$myposts = get_posts(array('orderby' => 'comment_count', 'numberposts' => $postscount));
//SHOW the posts
?>
<div class = "sidebar-box">
<div class="sidebar-box">
<h4><?php
echo $before_widget . $before_title . $title . $after_title;
?>
</h4>
<div class="sidebar-b">
<?php
foreach ($myposts as $post) {
setup_postdata($post);
$feat_image = wp_get_attachment_url(get_post_thumbnail_id($post->ID));
?>
<div class="sidebar-poppost">
<div class="sidebar-poppostimg"><img src="<?php
echo $feat_image;
?>
" alt="" class="img-responsive2"></div>
<div class="sidebar-popposttitle">
<a href="<?php
the_permalink();
?>
"><?php
the_title();
?>
</a>
<span>By <?php
the_author();
?>
on <?php
the_time('F j, Y');
?>
</span>
</div>
</div>
<?php
}
echo $after_widget;
?>
</div>
</div>
</div>
<?php
}
示例12: set_facebook_meta_tags
function set_facebook_meta_tags()
{
if (is_single()) {
?>
<!-- Open Graph Meta Tags for Facebook and LinkedIn Sharing !-->
<!-- HEY THIS PLUGIN WORKED -->
<meta property="og:title" content="<?php
the_title();
?>
"/>
<meta property="og:description" content="<?php
echo strip_tags(get_the_excerpt($post->ID));
?>
" />
<meta property="og:url" content="<?php
the_permalink();
?>
"/>
<?php
$fb_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'fb-image');
?>
<?php
if ($fb_image) {
?>
<meta property="og:image" content="<?php
echo $fb_image[0];
?>
" />
<?php
}
?>
<meta property="og:type" content="<?php
if (is_single() || is_page()) {
echo "article";
} else {
echo "website";
}
?>
"
/>
<meta property="og:site_name" content="<?php
bloginfo('name');
?>
"/>
<meta property="og:author" content="<?php
if (coauthors() == "") {
the_author();
} elseif (coauthors() != "") {
coauthors();
} else {
echo "";
}
?>
"/>
<!-- End Open Graph Meta Tags !-->
<?php
}
}
示例13: widget
function widget($args, $instance)
{
global $post;
$query_args = array('posts_per_page' => 5, 'meta_key' => 'luot_xem', 'order' => 'DESC', 'orderby' => 'meta_value_num');
$query = new WP_Query($query_args);
?>
<?php
echo $args['before_widget'];
?>
<?php
echo $args['before_title'] . 'Top 5' . $args['after_title'];
?>
<ul>
<?php
foreach ($query->get_posts() as $post) {
setup_postdata($post);
?>
<li>
<a href="<?php
the_permalink();
?>
">
<?php
the_post_thumbnail(array(90, 60), array("class" => "posts-widget-featured-image alignleft", "style" => "margin-right: 5px "));
?>
</a>
<a href="<?php
the_permalink();
?>
"><?php
the_title();
?>
</a>
<div class="posts-widget-meta">
<?php
print 'Lượt xem: ' . get_post_meta(get_the_ID(), 'luot_xem', true) . ' ,Bởi: ';
the_author();
?>
</div>
<div class="posts-widget-entry">
<?php
echo limit_post_word(get_the_content(), 30);
?>
</div>
<div style="clear: left"></div>
</li>
<?php
}
wp_reset_postdata();
?>
</ul>
<?php
echo $args['after_widget'];
}
示例14: c_widget_author
/**
* @desc Output of the Author
* @author Georg Leciejewski
*/
function c_widget_author($args, $number = 1)
{
$options = get_option('c_widget_author');
$before_widget = stripslashes($options[$number]['before_widget']);
$after_widget = stripslashes($options[$number]['after_widget']);
echo $before_widget . "\n";
the_author();
echo $after_widget . "\n";
}
示例15: rb_portfolio_add_authors
function rb_portfolio_add_authors()
{
include_once ABSPATH . 'wp-admin/includes/plugin.php';
if (is_plugin_active('co-authors-plus/co-authors-plus.php')) {
coauthors(', ', ' and ', '<span class="portfolio-authors">', '</span>');
} else {
the_author();
}
}