本文整理汇总了PHP中the_author_meta函数的典型用法代码示例。如果您正苦于以下问题:PHP the_author_meta函数的具体用法?PHP the_author_meta怎么用?PHP the_author_meta使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了the_author_meta函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: restful_post_meta_above
/**
* Post meta for above the post.
*/
function restful_post_meta_above()
{
global $post;
?>
<div class="entry__meta-item">
<i class="fa fa-calendar"></i>
<a href="<?php
esc_url(get_permalink());
?>
"><?php
the_time(get_option('date_format'));
?>
</a>
</div>
<div class="entry__meta-item">
<i class="fa fa-user"></i>
<a href="<?php
echo esc_url(get_author_posts_url($post->post_author));
?>
"><?php
the_author_meta('display_name', $post->post_author);
?>
</a>
</div>
<?php
if (comments_open() || have_comments()) {
?>
<div class="entry__meta-item">
<i class="fa fa-comment"></i>
<a href="<?php
esc_url(comments_link());
?>
"><?php
comments_number();
?>
</a>
</div>
<?php
}
?>
<?php
}
示例2: widget
function widget($args, $instance)
{
extract($args);
$instance[width] = $grid_width;
if (get_the_author_meta('description')) {
?>
<div id="author-info">
<div id="author-avatar">
<?php
echo get_avatar(get_the_author_meta('user_email'), 60);
?>
</div><!-- #author-avatar -->
<div id="author-description">
<h2><?php
printf(__('About %s', THEME_ADMIN_LANG_DOMAIN), get_the_author());
?>
</h2>
<?php
the_author_meta('description');
?>
</div><!-- #author-description -->
</div><!-- #entry-author-info -->
<?php
}
}
示例3: 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
}
示例4: widget
public function widget($args, $instance)
{
// outputs the content of the widget
global $post;
if (!empty($post)) {
}
echo $args['before_widget'];
echo get_avatar(get_the_author_meta('ID'), 40);
?>
<div class="author-text">
<div class="title"><?php
echo esc_html(siteorigin_setting('video_by_text', __('Video By', 'focus')));
?>
</div>
<div class="author"><?php
the_author_meta('display_name');
?>
</div>
</div>
<div class="clear"></div>
<div class="post-info"><?php
focus_posted_on();
?>
</div>
<?php
echo $args['after_widget'];
}
示例5: contributors
function contributors()
{
$contributors = get_users('orderby=nicename&role=contributor');
// Array of WP_User objects.
foreach ($contributors as $user) {
echo "<div class='author'>";
echo "<div class='author-image'><a href='" . get_author_posts_url($user->ID) . "'>" . get_avatar($user->ID) . "</a></div>";
echo "<div class='author-name'>" . the_author_meta('display_name', $user->ID) . "</div>";
echo "</div>";
}
}
示例6: section_template
/**
* Section template.
*/
function section_template()
{
global $post;
setup_postdata($post);
ob_start();
the_author_meta('url');
$link = ob_get_clean();
$default_avatar = PL_IMAGES . '/avatar_default.gif';
$author_email = get_the_author_meta('email', $post->post_author);
$author_name = get_the_author();
$author_desc = get_the_author_meta('description', $post->post_author);
$google_profile = get_the_author_meta('google_profile');
?>
<div class="media author-info">
<div class="img thumbnail author-thumb">
<a class="thumbnail" href="<?php
echo $link;
?>
" target="_blank">
<?php
echo get_avatar($author_email, '120', $default_avatar);
?>
</a>
</div>
<div class="bd">
<small class="author-note"><?php
_e('Author', 'pagelines');
?>
</small>
<h2>
<?php
echo $author_name;
?>
</h2>
<p><?php
echo $author_desc;
?>
</p>
<p class="author-details">
<?php
if ($link != '') {
printf('<a href="%s" class="btn" target="_blank"><i class="icon icon-external-link"></i> %s</a> ', $link, __('Visit Authors Website →', 'pagelines'));
}
if ($google_profile) {
printf('<a href="%s" class="btn" rel="me"><i class="icon icon-google-plus"></i> %s</a>', $google_profile, __('Authors Google Profile →', 'pagelines'));
}
?>
</p>
</div>
</div>
<div class="clear"></div>
<?php
}
示例7: widget
function widget($args, $instance)
{
extract($args);
if (!is_single()) {
return;
}
$title = apply_filters('widget_title', $instance['title']);
if (empty($title)) {
$title = false;
}
$show_gravatar = $instance['show_gravatar'] == 1 ? true : false;
$show_bio = $instance['show_bio'] == 1 ? true : false;
echo $before_widget;
if ($title) {
echo $before_title;
echo $title;
echo $after_title;
}
?>
<div class="author-info cf">
<?php
if ($show_gravatar) {
echo get_avatar(get_the_author_meta('email'), '60');
}
?>
<span><?php
echo stripslashes(get_option('dt_lang_gen_postedby'));
?>
<?php
the_author_posts_link();
?>
</span>
<?php
if ($show_bio) {
?>
<p><?php
the_author_meta('description');
?>
</p>
<?php
}
?>
</div><!-- .author-info -->
<?php
echo $after_widget;
}
示例8: jdh_toc_list_posts
function jdh_toc_list_posts($posts)
{
global $post;
foreach ($posts as $post) {
setup_postdata($post);
echo '<p><a href="' . get_permalink() . '">' . $post->post_title . '</a><br>';
if (function_exists('coauthors')) {
coauthors(',<br>');
} else {
echo the_author_meta('first_name') . ' ' . the_author_meta('last_name');
}
echo '</p>';
}
}
示例9: widget
function widget($args, $instance) {
global $post;
$posts = get_field('post', 'widget_'.$args['widget_id']);
if( $posts ) :
echo $args['before_widget'];
?>
<?php foreach($posts as $post) : ?>
<?php setup_postdata($post); ?>
<?php
$author_id = get_the_author_meta('ID');
$author_image = get_field('image', 'user_'. $author_id);
$author_img_url = get_avatar_url ( $author_id, $size = '40' );
$author_url = get_author_posts_url($author_id);
$excerpt = get_the_excerpt();
$excerpt = (strlen($excerpt) > 150) ? '"'.substr($excerpt,0,150).'" ...' : $excerpt;
?>
<img class="image" src="<?php echo get_image(get_post_thumbnail_id($post->ID), array(180, 180)); ?>">
<div class="script">
<img src="<?php bloginfo('template_directory'); ?>/images/misc/editors-letter.png" alt="">
</div>
<a href="<?php echo $author_url; ?>">
<div class="author">
<div class="image circle">
<img src="<?php echo $author_img_url; ?>" />
</div>
<span class="name"><?php echo the_author_meta( "display_name", $author_id ); ?></span>
</div>
</a>
<div class="date">
february 01,2015
</div>
<div class="bio">
<?php echo $excerpt; ?>
<a class="read-more" href="<?php the_permalink(); ?>">Read Further »</a>
</div>
<?php endforeach; ?>
<?
echo $args['after_widget'];
endif;
}
示例10: get_vendors_from_order
/**
* Vendor IDs and PayPal addresses from an order
*
* @param object $order
* @param unknown $items (optional)
*
* @return array
*/
public function get_vendors_from_order($order, $items = false)
{
if (!$items) {
$items = $order->get_items();
}
$vendors = array();
foreach ($items as $key => $product) {
$author = PV_Vendors::get_vendor_from_product($product['product_id']);
// Only store the vendor authors
if (!PV_Vendors::is_vendor($author)) {
continue;
}
$vendors[$author] = the_author_meta('author_paypal', $author);
}
return apply_filters('pv_vendors_from_order', $vendors, $order);
}
示例11: ait_type_custom_columns
function ait_type_custom_columns($column, $post_id)
{
switch ($column) {
case "thumbnail":
$width = (int) 100;
$height = (int) 100;
// thumbnail of WP 2.9
$thumbnail_id = get_post_meta($post_id, '_thumbnail_id', true);
// image from gallery
$attachments = get_children(array('post_parent' => $post_id, 'post_type' => 'attachment', 'post_mime_type' => 'image'));
if ($thumbnail_id) {
$thumb = @wp_get_attachment_image($thumbnail_id, array($width, $height), true);
} elseif ($attachments) {
foreach ($attachments as $attachment_id => $attachment) {
$thumb = @wp_get_attachment_image($attachment_id, array($width, $height), true);
}
}
if (isset($thumb) && $thumb) {
echo $thumb;
} else {
echo __('None', 'ait');
}
break;
case "menu_order":
$post = get_post($post_id);
echo $post->menu_order;
unset($post);
break;
case "content":
$post = get_post($post_id);
echo strip_tags($post->post_content);
unset($post);
break;
case "category":
$post_type = get_post_type($post_id);
echo get_the_term_list($post_id, $post_type . '-category', '', ', ');
break;
case "author":
$post = get_post($post_id);
the_author_meta('user_nicename', $post->post_author);
break;
}
}
示例12: members_author_profile
/**
* Use to put an author box at the end/beginning of a post. This template
* tag should be used within The Loop.
*
* @since 0.1
* @uses get_avatar() Gets the current author's avatar.
* @uses get_the_author_meta() Grabs information about the author.
*/
function members_author_profile()
{
?>
<div class="author-profile vcard">
<?php
echo get_avatar(get_the_author_meta('user_email'), '100', '', get_the_author_meta('display_name'));
?>
<h4 class="author-name fn n"><?php
the_author_posts_link();
?>
</h4>
<p class="author-description author-bio">
<?php
the_author_meta('description');
?>
</p>
</div>
<?php
}
示例13: widget
function widget($args, $instance)
{
extract($args, EXTR_SKIP);
if (is_single()) {
echo $before_widget;
$title = apply_filters('widget_title', $instance['title']);
if (!empty($title)) {
echo $before_title . $title . $after_title;
}
echo '<div class="author-data">';
echo get_avatar(get_the_author_meta('user_email'), 150);
echo '<h4>' . the_author_meta('display_name') . '</h4>';
// Is there an author description?
if (get_the_author_meta('description')) {
echo '<div class="description"><p>' . get_the_author_meta('description') . '</p></div>';
}
echo '</div>';
echo $after_widget;
}
}
示例14: bwpp_entry_footer
/**
* Prints HTML with meta information for the categories, tags and comments.
*/
function bwpp_entry_footer()
{
// 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__(', ', 'bwpp'));
if ($categories_list && bwpp_categorized_blog()) {
printf('<span class="cat-links">' . esc_html__('Posted in %1$s', 'bwpp') . '</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__(', ', 'bwpp'));
if ($tags_list) {
printf('<span class="tags-links">' . esc_html__('Tagged %1$s', 'bwpp') . '</span>', $tags_list);
// WPCS: XSS OK.
}
}
if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
echo '<span class="comments-link">';
comments_popup_link(esc_html__('Leave a comment', 'bwpp'), esc_html__('1 Comment', 'bwpp'), esc_html__('% Comments', 'bwpp'));
echo '</span>';
}
if (is_single() || is_singular()) {
?>
<div class="author-overview clear">
<?php
echo get_avatar(get_the_author_meta('ID'), 100);
?>
<div class="author-name"><?php
the_author_meta('display_name');
?>
</div>
<p><?php
the_author_meta('description');
?>
</p>
</div>
<?php
}
edit_post_link(sprintf(esc_html__('Edit %s', 'bwpp'), the_title('<span class="screen-reader-text">"', '"</span>', false)), '<span class="edit-link">', '</span>');
}
示例15: section_template
function section_template()
{
global $post;
setup_postdata($post);
?>
<div class="author-info">
<div class="author-thumb">
<?php
echo get_avatar(get_the_author_meta('email', $post->post_author), $size = '80', $default = CORE_IMAGES . '/avatar_default.gif');
?>
</div>
<small class="subtext"><?php
_e('About The Author', 'pagelines');
?>
</small>
<h2>
<?php
echo get_the_author();
?>
</h2>
<p><?php
the_author_meta('description', $post->post_author);
?>
</p>
<div class="author-details">
<a href="<?php
the_author_meta('url');
?>
" target="_blank">
<?php
_e('Visit Authors Website', 'pagelines');
?>
→
</a>
</div>
</div>
<div class="clear"></div>
<?php
}