本文整理汇总了PHP中get_the_author_id函数的典型用法代码示例。如果您正苦于以下问题:PHP get_the_author_id函数的具体用法?PHP get_the_author_id怎么用?PHP get_the_author_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_the_author_id函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: theme_author_box
function theme_author_box()
{
$authinfo = "<div class=\"postauthor vcard\">\r\n";
$authinfo .= "<span class=\"sourceavatar\">" . get_avatar(get_the_author_id(), 300) . "</span>";
$authinfo .= "<h4> About the source: " . "<span class=\"fn\">" . get_the_author_meta('display_name') . "</span>" . "</h4>\r\n";
$authinfo .= "<p><span class=\"note\">" . get_the_author_meta('description') . "</span></p>\r\n";
$facebook = get_the_author_meta('facebook');
$twitter = get_the_author_meta('twitter');
$gplus = get_the_author_meta('gplus');
$blog_title = get_the_author_meta('user_url');
$flength = strlen($facebook);
$tlength = strlen($twitter);
$glength = strlen($gplus);
$llength = strlen($blog_title);
$authsocial = "<div class=\"postauthor-bottom\"> <p>\r\n";
if ($flength > 1) {
$authsocial .= "<i class=\"fa fa-facebook-official\"></i><a class=\"author-fb url\" href=\"http://facebook.com/" . $facebook . "\" target=\"_blank\" rel=\"nofollow\" title=\"" . get_the_author_meta('display_name') . " on Facebook\">Facebook</a>";
}
if ($glength > 1) {
$authsocial .= "<i class=\"fa fa-google-plus-square\"></i><a class=\"author-gplus url\" href=\"" . $gplus . "\" rel=\"me\" target=\"_blank\" title=\"" . get_the_author_meta('display_name') . " on Google+\">Google+</a>";
}
if ($tlength > 1) {
$authsocial .= "<i class=\"fa fa-twitter-square\"></i><a class=\"author-twitter url\" href=\"http://twitter.com/" . $twitter . "\" target=\"_blank\" rel=\"nofollow\" title=\"" . get_the_author_meta('display_name') . " on Twitter\">Twitter</a>";
}
if ($llength > 1) {
$authsocial .= "<i class=\"fa fa-wordpress\"></i><a class=\"author-blog url\" href=\"" . $blog_title . "\" target=\"_blank\" rel=\"nofollow\" title=\"" . get_the_author_meta('display_name') . " Personal Blog\">Website</a>";
}
$authsocial .= "</p>\r\n";
$authsocial .= "</div></div>\r\n";
if (is_single() || is_author()) {
echo $authinfo;
echo $authsocial;
}
}
示例2: wsm_author_box_pattern
function wsm_author_box_pattern($pattern)
{
$gravatar = get_avatar(get_the_author_id(), 76);
$description = get_the_author_meta('description');
$pattern = '<div class="author-box"><h3>By ' . get_the_author_meta('display_name') . '</h3>' . $gravatar . ' <p class="author-description">' . $description . '</p></div>';
return $pattern;
}
示例3: authorWidget
function authorWidget()
{
$settings = get_option("widget_authorwidget");
$title = $settings['title'];
if ($title == "") {
$title = __('Author Info', 'woothemes');
}
if (is_single()) {
?>
<div id="author" class="widget">
<h3 class="widget_title"><img src="<?php
bloginfo('template_directory');
?>
/images/ico-author.png" alt="" /><?php
echo $title;
?>
</h3>
<div class="wrap">
<div class="fl"><?php
echo get_avatar(get_the_author_id(), '48');
?>
</div>
<span class="author-info"><?php
_e('This post was written by', 'woothemes');
?>
<?php
the_author_posts_link();
?>
<?php
_e('who has written', 'woothemes');
?>
<?php
the_author_posts();
?>
<?php
_e('posts on', 'woothemes');
?>
<a href="<?php
echo get_option('home');
?>
/"><?php
bloginfo('name');
?>
</a>.</span>
<br class="fix"></br>
<p class="author-desc"><?php
the_author_description();
?>
</p>
</div>
</div>
<?php
}
}
示例4: uppsite_get_member
function uppsite_get_member()
{
$avatar = null;
if (function_exists('get_the_author_meta')) {
$avatar = get_avatar(get_the_author_meta('user_email'));
} elseif (function_exists('get_the_author_id')) {
$avatar = get_avatar(get_the_author_id());
}
return array('name' => get_the_author(), 'link' => get_the_author_link(), 'avatar' => uppsite_extract_src_url($avatar));
}
示例5: Sync_post
public function Sync_post($select, $where, $refguid, $limit)
{
global $wp, $wpdb;
$where .= " AND {$wpdb->posts}.ID < " . $refguid;
$querystr = $select . $where . " ORDER BY {$wpdb->posts}.ID ASC LIMIT " . $limit;
$posts_list = $wpdb->get_results($querystr);
error_log("Sync - " . $querystr);
$struct = array();
if (!$posts_list) {
return $struct;
}
foreach ($posts_list as $post) {
//error_log("post id ".$post['ID']);
$post = get_object_vars($post);
// Do we have permission to read this post?
if (!json_check_post_permission($post, 'read')) {
continue;
}
$post_data["guid"] = $post['ID'];
$post_data["title"] = $post['post_title'];
$post_data["description"] = strip_tags($post['post_content']);
$authorid = get_the_author_id($post);
$post_data["iconurl"] = get_avatar_url($authorid);
//$post_data["icontime"] = $post['post_title'];
$post_data["time"] = get_post_modified_time('U', false, $post, false);
if (is_wp_error($post_data)) {
continue;
}
//error_log("ajaay".serialize($post));
$struct[] = $post_data;
}
return $struct;
}
示例6: the_author_ID
/**
* Display the ID of the author of the current post.
*
* @link http://codex.wordpress.org/Template_Tags/the_author_ID
* @since 0.71
* @uses get_the_author_ID()
*/
function the_author_ID()
{
echo get_the_author_id();
}
示例7: get_the_author_id
?>
</a></h1>
</section>
</div>
<div class="page-main">
<section class="layout">
<div class="profile-page">
<div id="tabs" class="science-tabs">
<ul>
<div class="author-info">
<?php
$author_id = get_the_author_id();
$author = get_userdata($author_id);
if (SCIENCE_ID) {
if (get_option('permalink_structure') == '/%postname%/') {
$sb_url = get_the_permalink(SCIENCE_ID) . '/' . $author->user_nicename;
} else {
$sb_url = add_query_arg(array('sb' => $author->user_nicename), get_the_permalink(SCIENCE_ID));
}
}
if ($sb_url !== null) {
echo '<div class="author-pic"><a href="' . $sb_url . '"><img src="' . get_user_meta($author_id, '_naiau_user_picture', 1) . '" alt="' . $author->display_name . '" title="' . $author->display_name . '"/></a></div>';
} else {
echo '<span class="author-name">' . get_the_author() . '</span>';
}
?>
</div>
示例8: the_field
?>
" target="_blank">x</a>
<?php
}
if (get_field('user_yt', 'user_' . get_the_author_id())) {
?>
<a class="socicon" href="<?php
the_field('user_yt', 'user_' . get_the_author_id());
?>
" target="_blank">r</a>
<?php
}
if (get_field('user_pin', 'user_' . get_the_author_id())) {
?>
<a class="socicon" href="<?php
the_field('user_pin', 'user_' . get_the_author_id());
?>
" target="_blank">d</a>
<?php
}
?>
</p>
</div>
</div>
</div>
</div>
</div>
</section>
<?php
if (have_posts()) {
示例9: get_avatar
</strong>.
<h3>About Author</h3>
<p class="gravatar"><?php
echo get_avatar(get_the_author_id(), $size = '96');
?>
</p>
<p class="nickname loud"><strong><?php
the_author_meta('display_name', get_the_author_id());
?>
</strong></p>
<p class="author_url">
<a href="<?php
the_author_meta('user_url', get_the_author_id());
?>
"><?php
the_author_meta('user_url', get_the_author_id());
?>
</a></p>
<p>Read more about <?php
the_author_posts_link();
?>
</p>
<h3>Share The Love</h3>
<p><a tagret="_blank" href="<?php
echo 'http://www.twitter.com/?status=' . get_the_title() . ' ' . get_bloginfo('url');
?>
/?post_id=<?php
echo $post->ID;
?>
" title="twitter"><img src="<?php
bloginfo('template_url');
示例10: get_post_format
echo get_post_format();
?>
-format post-<?php
the_ID();
?>
" <?php
post_class();
?>
>
<header class="entry-header">
<a href="<?php
echo get_author_posts_url(get_the_author_meta('ID'));
?>
">
<?php
$author_image = get_field('profile_image', 'user_' . get_the_author_id());
?>
<img src="<?php
echo $author_image['sizes']['thumbnail'];
?>
" width="<?php
echo $author_image['sizes']['thumbnail-width'];
?>
" height="<?php
echo $author_image['sizes']['thumbnail-height'];
?>
">
</a>
<?php
the_title('<h1 class="entry-title">', '</h1>');
?>
示例11: get_post_meta
$postcount++;
$meta = get_post_meta(get_the_id());
$key_1_values = get_post_meta(get_the_ID(), '', true);
$field = get_field_object('budget');
$field1 = get_field_object('genre');
$field11 = get_field_object('production_stage');
$field2 = get_field_object('compares');
$field3 = get_field_object('tax_breaks');
$field4 = get_field_object('team');
$field5 = get_field_object('cast');
$field6 = get_field_object('investor_info');
$field7 = get_field_object('target');
$field8 = get_field_object('invested');
$field9 = get_field_object('soft');
$field10 = get_field_object('investers');
$user_ID = get_the_author_id();
$select_financ = get_user_meta($user_ID, 'select_financ', true);
$select_creative = get_user_meta($user_ID, 'select_creative', true);
$finance_package = get_user_meta($user_ID, 'finance_package', true);
$creative_package = get_user_meta($user_ID, 'creative_package', true);
$add_image = get_user_meta($user_ID, 'add_image', true);
$u_vid = false;
$u_vid = userpro_profile_data('video', $user_ID);
?>
<div class="col-sm-6 col-md-3 <?php
echo $user_ID;
?>
">
<div class="pro-box">
<div class="img-thumb">
<h4><?php
示例12: while
while (have_posts()) {
the_post();
$author_feed_url = '';
if (function_exists('get_author_feed_link')) {
$author_feed_url = get_author_feed_link(get_the_author_ID());
} else {
$author_feed_url = get_author_rss_link(false, get_the_author_ID(), get_the_author_nickname());
}
?>
<?php
if ($first_post === true) {
?>
<h2>
<?php
echo prologue_get_avatar(get_the_author_id(), get_the_author_email(), 48);
?>
Updates from <?php
the_author_posts_link();
?>
<a class="rss" href="<?php
echo $author_feed_url;
?>
">RSS</a>
</h2>
<?php
}
// first_post
?>
<ul>
示例13: edit_post_link
edit_post_link(' Edit', '', ' |');
if (function_exists('getILikeThis')) {
getILikeThis('get');
}
?>
| <?php
comments_popup_link('No Comments »', '1 Comment »', '% Comments »');
?>
</div>
</div>
<?php
} else {
?>
<div class="minimize">
<div style="float: right;"><?php
echo get_avatar(get_the_author_id(), $size = '56', $default = '');
?>
</div>
<h2><a href="<?php
the_permalink();
?>
" rel="bookmark" title="Permanent Link to <?php
the_title_attribute();
?>
"><?php
the_title();
?>
</a></h2>
<div>Posted by <?php
the_author_posts_link();
$aff = get_the_author_meta('affiliation', get_the_author_meta('ID'));
示例14: autor
<article class="item title-template">
<h1>
El archivo <em>author.php</em> es el archivo que toma por defecto WordPress para mostrar la página de perfil del autor (usuario) actual.
</h1>
</article>
';
$template_author = '
<ul class="item author-info">
<li>Autor: <b>%s</b></li>
<li>ID Autor: <b>%s</b></li>
<li>Correo: <b>%s</b></li>
<li>Login: <b>%s</b></li>
<li>Password: <b>%s</b></li>
<li>Nicename: <b>%s</b></li>
<li>URL Autor: <b>%s</b></li>
<li>URL Página Autor: <b>%s</b></li>
<li>Fecha y Hora de Registro: <b>%s</b></li>
<li>Rol: <b>%s</b></li
<li>Nombre para mostrar: <b>%s</b></li>
<li>Alias: <b>%s</b></li>
<li>Nombre: <b>%s</b></li>
<li>Apellido: <b>%s</b></li>
<li>Descripción: <b>%s</b></li>
<li>Número de Publicaciones: <b>%s</b></li>
<li>Avatar: %s</li>
</ul>
';
printf($template_author, get_the_author(), get_the_author_id(), get_the_author_meta('user_email'), get_the_author_meta('user_login'), get_the_author_meta('user_pass'), get_the_author_meta('user_nicename'), get_the_author_meta('user_url'), get_author_posts_url(get_the_author_id()), get_the_author_meta('user_registered'), get_the_author_meta('roles')[0], get_the_author_meta('display_name'), get_the_author_meta('nickname'), get_the_author_meta('first_name'), get_the_author_meta('last_name'), get_the_author_meta('description'), get_the_author_posts(), get_avatar(get_the_author_id(), 50));
get_template_part('content');
get_sidebar();
get_footer();
示例15: get_query_var
<section id="primary" class="content-area">
<main id="main" class="site-main list-page" role="main">
<?php
$curauth = get_query_var('author_name') ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
if (have_posts()) {
?>
<header class="page-header">
<?php
$title = sprintf(__('Posts by %s'), '<span class="vcard">' . get_the_author() . '</span>');
echo '<h1 class="page-title">' . $title . '</h1>';
the_archive_description('<div class="taxonomy-description">', '</div>');
echo do_shortcode("[user id=" . $curauth->ID . "]");
if ($curauth->caps['contributor'] == "1") {
echo '<p><a class="btn" href="/student-voices/contact?blogger=' . get_the_author_meta('user_nicename', get_the_author_id()) . '">Ask ' . get_the_author() . ' a question</a></p>';
}
?>
</header><!-- .page-header -->
<?php
// Start the Loop.
while (have_posts()) {
the_post();
/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*
get_template_part( 'content', get_post_format() );
*/