• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_the_author_id函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_the_author_id函数的典型用法代码示例。如果您正苦于以下问题:PHP get_the_author_id函数的具体用法?PHP get_the_author_id怎么用?PHP get_the_author_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_the_author_id函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
    }
}
开发者ID:ashenkar,项目名称:sanga,代码行数:34,代码来源:custom-author-box.php


示例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;
}
开发者ID:Bobcatou,项目名称:enhanceworldwide,代码行数:7,代码来源:functions.php


示例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 
    }
}
开发者ID:juslee,项目名称:e27,代码行数:56,代码来源:theme-widgets.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));
}
开发者ID:alpual,项目名称:Caitlin-Sabo,代码行数:10,代码来源:functions.php


示例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;
 }
开发者ID:enraiser,项目名称:engap,代码行数:33,代码来源:class-engap-posts.php


示例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();
}
开发者ID:schr,项目名称:wordpress,代码行数:11,代码来源:author-template.php


示例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>
开发者ID:hamednourhani,项目名称:naiau.ac.ir,代码行数:31,代码来源:single-course.php


示例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()) {
开发者ID:developmentDM2,项目名称:Whohaha,代码行数:31,代码来源:author.php


示例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');
开发者ID:neerajsohal,项目名称:portraiture,代码行数:31,代码来源:sidebar-single.php


示例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>');
?>
开发者ID:developmentDM2,项目名称:Whohaha,代码行数:31,代码来源:content-single.php


示例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 
开发者ID:fritzdenim,项目名称:pangMoves,代码行数:31,代码来源:page-UserProject.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>
开发者ID:rmccue,项目名称:wordpress-unit-tests,代码行数:31,代码来源:author.php


示例13: edit_post_link

            edit_post_link(' Edit', '', ' |');
            if (function_exists('getILikeThis')) {
                getILikeThis('get');
            }
            ?>
 | <?php 
            comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;');
            ?>
</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'));
开发者ID:mkalam-alami,项目名称:ludumdare-2008,代码行数:31,代码来源:index.php


示例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();
开发者ID:jonmircha,项目名称:iconos29,代码行数:31,代码来源:author.php


示例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() );
        */
开发者ID:university-of-york,项目名称:blog-theme,代码行数:31,代码来源:author.php


示例16: WP_Query

$author = 1;
$monthAndYear = 2;
$the_query = new WP_Query(array('category_name' => 'News'));
if ($the_query->have_posts()) {
    while ($the_query->have_posts()) {
        $the_query->the_post();
        $posttags = get_the_tags();
        if ($posttags) {
            foreach ($posttags as $tag) {
                $post_info[$topics][$tag->name] = $tag->name;
            }
        }
        $year = get_the_date('Y', '', '', false);
        $month = get_the_date('m', '', '', false);
        $writtenMonth = get_the_date('M', '', '', false);
        $post_info[$author][get_the_author()] = get_the_author_id();
        $post_info[$monthAndYear][$writtenMonth . ' ' . $year] = $year . '-' . $month;
    }
} else {
}
wp_reset_postdata();
?>

<?php 
include 'header.php';
?>

<!-- end inlude header --> 
<?php 
get_template_part('banner', 'interior');
?>
开发者ID:jason-nc,项目名称:Custom_Wordpress_Theme,代码行数:31,代码来源:news.php


示例17: get_single_page_values

 function get_single_page_values($fields = [])
 {
     // extraction des champs/valeurs d'une table
     if (count($fields) == 0) {
         $fields = ['id', 'title', 'content', 'author-id', 'author-name'];
     }
     global $post;
     $id = $post->ID;
     $data = array();
     if (array_search('id', $fields) !== false) {
         $data['id'] = $id;
     }
     if (array_search('title', $fields) !== false) {
         $data['title'] = get_the_title();
     }
     if (array_search('content', $fields) !== false) {
         $base = get_the_content();
         // pb : pas de paragraphes :/
         $data['content'] = wpautop($base, true);
         // et hop paragraphes à la wordpress !
     }
     if (array_search('author-id', $fields) !== false) {
         $data['author-id'] = get_the_author_id();
     }
     if (array_search('author-name', $fields) !== false) {
         $data['author-name'] = get_the_author();
     }
     // + de détails sur l'auteur : status, level, etc
     // https://codex.wordpress.org/Function_Reference/get_the_author_meta
     return $data;
 }
开发者ID:SamuelRiversMoore,项目名称:archipels-graph,代码行数:31,代码来源:get-json-atlas.php


示例18: shortcode_the_author_ID

/**
 * Shortcode function for displaying the current post author ID
 * Uses the get_the_author_id() function
 * @link http://codex.wordpress.org/Template_Tags/the_author_ID
 *
 * @since 0.1
 */
function shortcode_the_author_ID()
{
    return get_the_author_id();
}
开发者ID:jfitzsimmons,项目名称:soundtrackforspace,代码行数:11,代码来源:template-tag-shortcodes.php


示例19: esc_url

?>
		<?php 
if ($link_audio != '') {
    ?>
			<div class="audio-player">
				<iframe height="166" scrolling="no" frameborder="no" src="<?php 
    echo esc_url(get_post_meta(get_the_ID(), "_cmb_link_audio", true));
    ?>
&amp;color=ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_artwork=true"></iframe>
			</div>
		<?php 
}
?>
		<div class="blog-text-wrap">
			<?php 
echo get_avatar(get_the_author_id(), '70');
?>
			<div class="blog-text-name"><?php 
the_author_posts_link();
?>
</div>
			<h3><a href="<?php 
the_permalink();
?>
"><?php 
the_title();
?>
</a></h3>
			<div class="blog-text-date"><?php 
the_time('d.m.Y.');
?>
开发者ID:azeemgolive,项目名称:thefunkidsgame,代码行数:31,代码来源:content-audio.php


示例20: the_time

						<?php 
        the_time('d-M-Y g:i a');
        ?>
					</small>
				</p>
				<p>Categorías:</p>
				<?php 
        the_category();
        ?>
				<p><?php 
        the_tags();
        ?>
</p>
				<p>
					<a href="<?php 
        print get_author_posts_url(get_the_author_id());
        ?>
">
						<i class="fa  fa-user"></i>
						<?php 
        the_author();
        ?>
					</a>
				</p>
				<?php 
        if (is_page() || is_single()) {
            print '<div class="content-section">';
            the_content();
            print '</div>';
        }
        if (is_single()) {
开发者ID:jonmircha,项目名称:iconos30,代码行数:31,代码来源:content.php



注:本文中的get_the_author_id函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_the_author_link函数代码示例发布时间:2022-05-15
下一篇:
PHP get_the_author_email函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap