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

PHP the_author函数代码示例

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

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



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


示例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;
    }
}
开发者ID:helgatheviking,项目名称:wp-knowledgebase,代码行数:32,代码来源:kbe_articles.php


示例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 
    }
}
开发者ID:rick-maclean,项目名称:webonaryLinuxCopy,代码行数:32,代码来源:entry.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 
    }
开发者ID:puikinsh,项目名称:shapely,代码行数:35,代码来源:template-tags.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');
        ?>
&nbsp;<?php 
        the_author();
        ?>
</a>
</div>
<?php 
    }
开发者ID:wenqingyu,项目名称:enterprise-management-system,代码行数:31,代码来源:template-tags.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 
    }
开发者ID:2nickpick,项目名称:acf-commits,代码行数:33,代码来源:acf-commits-partials.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 . '>';
 }
开发者ID:neetudave,项目名称:heartfulness-uk,代码行数:27,代码来源:markup.php


示例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();
    }
开发者ID:tldjssla,项目名称:jejufoodwinefestival,代码行数:32,代码来源:post-functions.php


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


示例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;
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:59,代码来源:wp_contents.php


示例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 
    }
开发者ID:abcode619,项目名称:wpstuff,代码行数:58,代码来源:class-custome-popular-posts.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 
    }
}
开发者ID:elliebartling,项目名称:skepticalblue,代码行数:58,代码来源:functions.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'];
    }
开发者ID:bynos0001,项目名称:wp,代码行数:58,代码来源:bai-xem-nhieu.php


示例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";
}
开发者ID:jbogota,项目名称:blog-king,代码行数:13,代码来源:c_widget_author.php


示例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();
    }
}
开发者ID:redblueconcepts,项目名称:redblue-portfolio,代码行数:9,代码来源:functions.php


示例16: hsinsider_get_coauthors

function hsinsider_get_coauthors()
{
    if (function_exists('coauthors')) {
        $coauthors = coauthors_posts_links(null, null, null, null, false);
    } else {
        $coauthors = the_author();
    }
    return $coauthors;
}
开发者ID:jperezlatimes,项目名称:hsinsider,代码行数:9,代码来源:authors.php


示例17: nm_home_tabs

function nm_home_tabs($cats, $width = 463, $height = 210)
{
    $cats = explode(',', $cats);
    $cat = get_category_by_slug($cats[0]);
    $cat = get_category($cat->category_parent);
    echo '<div id="tab-instance-' . $cat->slug . '" class="tabs" style="width: ' . $width . 'px;"><ul class="tabs-nav">';
    $class = ' class="tabs-nav-active"';
    //Generate the nav from the cats
    foreach ($cats as $cat) {
        $cat = get_category_by_slug($cat);
        echo '<li><a id="a-' . $cat->slug . '"' . $class . ' href="javascript:show_home_tab(\'a-' . $cat->slug . '\')">' . $cat->name . '</a></li>';
        $class = '';
    }
    echo '</ul><div class="tabs-content" style="height: ' . $height . 'px;">';
    foreach ($cats as $cat) {
        echo '<ul id="ul-' . $cat . '" class="tabs-content-ul">';
        //Check if is older then 3 days, if is then order by rand
        $orderby = '';
        query_posts('showposts=1&category_name=' . $cat);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                $older = date('YMD');
                $days_since = floor((date('U') - get_the_time('U')) / 86400);
                if ($days_since >= 4) {
                    $orderby = '&orderby=rand';
                }
            }
        }
        query_posts('showposts=5&category_name=' . $cat . $orderby);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                global $post;
                echo '<li class="tabs-content-item">
					<h4><a href="' . get_permalink() . '">' . $post->post_title . '</a></h4>' . '<a href="' . get_permalink() . '">' . article_image($post->ID, 'small', true) . '</a>';
                echo '<p>';
                wswwpx_content_extract('', '15', '15', 2, '', '', TRUE, FALSE);
                echo '</p>';
                echo '<p class="tabs-content-meta">';
                echo '<a href="' . get_permalink() . '">';
                comments_number('No Comments', '1 Comment', '% Comments');
                echo '</a> | Posted: ';
                the_time('l, F jS, Y');
                echo ' | By: <a href="' . getProfileLink($post->post_author) . '">';
                the_author();
                echo '</a>';
                echo '</p>';
                echo '</li>';
            }
        }
        echo '</ul>';
    }
    echo '</div>
		</div>';
}
开发者ID:popovdenis,项目名称:kmst,代码行数:56,代码来源:nm-home-tabs.php


示例18: ace_post_author

function ace_post_author()
{
    if (get_option('ace_blog_author')) {
        echo ' <span class="vcard author post-author" itemprop="author" itemscope="itemscope" itemtype="http://schema.org/Person">';
        echo _e('by', 'ace');
        echo ' <span class="fn" itemprop="name">';
        the_author();
        echo '</span></span>';
    }
}
开发者ID:michellemarin,项目名称:marilyn,代码行数:10,代码来源:ace_functions.php


示例19: aps_news_author

function aps_news_author()
{
    $id = get_the_author_meta('ID');
    $link = bp_core_get_user_domain($id);
    if (isset($link)) {
        echo '<a href="' . $link . '">' . get_the_author() . '</a>';
    } else {
        the_author();
    }
}
开发者ID:gato-gordo,项目名称:association-print-scholars,代码行数:10,代码来源:news_functions.php


示例20: wcr_author_loop

function wcr_author_loop()
{
    $args = array('author' => get_the_author_meta('ID'), 'orderby' => 'post_date', 'order' => 'DESC', 'posts_per_page' => '10');
    $loop = new WP_Query($args);
    if ($loop->have_posts()) {
        // loop through posts
        while ($loop->have_posts()) {
            $loop->the_post();
            ?>

			<article class="entry" itemprop="blogPost" itemtype="http://schema.org/BlogPosting" itemscope="itemscope">
                <header class="entry-header"> 
                <a href="<?php 
            echo get_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
">
                <h1 itemprop="headline">  <?php 
            the_title();
            ?>
 </h1>
                </a>
                <p class="entry-meta">

				<?php 
            the_time('l, F jS, Y');
            echo ' by ';
            the_author();
            ?>


                </header>
                    <div class="author-blog entry-content">
                  <?php 
            if (has_post_thumbnail()) {
                the_post_thumbnail('medium');
            }
            ?>
                  <?php 
            the_excerpt();
            ?>
                    </div>
                <footer>
                Categories: <?php 
            the_category(', ');
            ?>
                </footer>
            </article>
<?php 
        }
    }
    wp_reset_postdata();
}
开发者ID:andrygorokhovets,项目名称:western,代码行数:55,代码来源:mike-page.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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