当前位置: 首页>>代码示例>>PHP>>正文


PHP coauthors函数代码示例

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


在下文中一共展示了coauthors函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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

示例2: 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

示例3: 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>';
    }
}
开发者ID:arshanam,项目名称:JDH-theme,代码行数:14,代码来源:functions.php

示例4: pabx_add_replace_values

/**
* Set replacement values for specific tokens with Post Author Box
*/
function pabx_add_replace_values($tokens)
{
    global $coauthors_plus;
    if (!function_exists('coauthors')) {
        return $tokens;
    }
    $coauthor = array_shift(get_coauthors());
    // Co-Authors Plus specific tokens
    $tokens['%coauthors%'] = coauthors(null, null, null, null, false);
    $tokens['%coauthors_posts_links%'] = coauthors_posts_links(null, null, null, null, false);
    $tokens['%coauthors_firstnames%'] = coauthors_firstnames(null, null, null, null, false);
    // Modify these tokens too, because they might be guest authors
    $tokens['%display_name%'] = $coauthor->display_name;
    $tokens['%first_name%'] = $coauthor->first_name;
    $tokens['%last_name%'] = $coauthor->last_name;
    $tokens['%description%'] = $coauthor->description;
    $tokens['%email%'] = $coauthor->email;
    $tokens['%jabber%'] = $coauthor->jabber;
    $tokens['%aim%'] = $coauthor->aim;
    $tokens['%avatar%'] = get_avatar($coauthor->user_email);
    return $tokens;
}
开发者ID:gopinathshiva,项目名称:wordpress-vip-plugins,代码行数:25,代码来源:wpcom-helper.php

示例5: post_class

" <?php 
        post_class();
        ?>
>
<div class="post-entry">
<h2 class="entry-title post-title grid-col-220"><a href="<?php 
        the_permalink();
        ?>
" rel="bookmark"><?php 
        the_title();
        ?>
</a></h2>
<div class="post-meta">
<span class="byline">By</span> <span class="author vcard"><?php 
        if (function_exists('coauthors')) {
            coauthors();
        } else {
            get_the_author();
        }
        ?>
</span> | <i class="fa fa-calendar"></i> <?php 
        the_time('F j, Y');
        ?>
</div>

					<?php 
        if (has_post_thumbnail()) {
            ?>
					<div class="pbd-thumb"><a href="<?php 
            the_permalink();
            ?>
开发者ID:GabeDiaz,项目名称:responsive-child,代码行数:31,代码来源:home.php

示例6: the_permalink

                <div class="intro-post six columns omega">
            <?php 
        }
        ?>
                <h3><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h3>
                <?php 
        if (function_exists('coauthors')) {
            ?>
                    <h4 class="author-name"><?php 
            coauthors(',<br>');
            ?>
</h4>
                <?php 
        } else {
            ?>
                    <h4 class="author-name"><?php 
            echo the_author_meta('first_name');
            ?>
 <?php 
            echo the_author_meta('last_name');
            ?>
</h4>
                <?php 
        }
        ?>
开发者ID:arshanam,项目名称:JDH-theme,代码行数:31,代码来源:table-of-contents.php

示例7: elseif

            ?>
						<?php 
            if (coauthors(null, null, null, null, false) === "Staff Reports") {
                ?>
							<span class="author" itemprop="author">Staff Reports</span>
						<?php 
            } elseif (coauthors(null, null, null, null, false) === "The Editorial Board") {
                ?>
							<a href="<?php 
                bloginfo('wpurl');
                ?>
/opinion/editorial/" title="More Pipe Dream editorials">
								<span class="author" itemprop="author">The Editorial Board</span>
							</a>
						<?php 
            } elseif (coauthors(null, null, null, null, false) === "archives") {
                ?>
							<span class="author" itemprop="author">
								<?php 
                if (isset($archive['_author'])) {
                    echo $archive['_author'];
                } else {
                    if (strpos(get_the_title(), 'to the editor') !== 0) {
                        // new posts are often misattributed to "archives"
                        // causing all sorts of issues.
                        echo "Guest Author";
                    }
                }
                ?>
							</span>
						<?php 
开发者ID:wsander3,项目名称:Pipe-Dream,代码行数:31,代码来源:single-post.php

示例8: fake_is_home

<div class="interior-content">
    <div id="mainColumn">
        <h1>Latest News</h1>

        <div class="wide" id="news">
        <?php
        function fake_is_home($args) {
            // Really doesn't filter posts_results.
            // Set is_home = 1 to allow sticky posts to be honored.
            global $wp_query;
            $wp_query->is_home = 1;
            return $args;
        }
        add_filter('posts_results', 'fake_is_home');
        query_posts("cat=3,-11&posts_per_page=10&paged=&order=DESC&paged=" . get_query_var('paged'));
        while (have_posts()) :the_post(); ?>
            <div class="news-story">
                <h2><a href="<?php the_permalink(); ?>"><?php the_title() ?></a></h2>
                <span class="date">By <?php coauthors(); ?>, <?php the_time("F j, Y"); ?><br><?php the_category(", "); ?></span>
                <p><?php excerpt(30) ?></p>
            </div>
        <?php endwhile; ?>
        <?php wp_pagenavi() ?>
        </div>
    </div>
    <div id="sideColumn">
    <?php get_sidebar(); ?>
    </div>
</div>
<?php get_footer(); ?>
开发者ID:realfluid,项目名称:umbaugh,代码行数:30,代码来源:latest-news.php

示例9: filter_the_author

 function filter_the_author()
 {
     return coauthors(null, null, null, null, false);
 }
开发者ID:gopinathshiva,项目名称:wordpress-vip-plugins,代码行数:4,代码来源:class-coauthors-template-filters.php

示例10: get_post_thumbnail_id

$thumbnail_id = get_post_thumbnail_id();
// Post featured image as FB IA cover image.
if (!$has_article_cover && $thumbnail_id) {
    Simple_FB_Instant_Articles::instance()->render_image_markup($thumbnail_id);
}
the_title('<h1>', '</h1>');
if (function_exists('the_subheading')) {
    the_subheading('<h2>', '</h2>');
}
?>

	<?php 
if (function_exists('coauthors')) {
    ?>
		<?php 
    coauthors('</address>, <address>', ' </address> and <address> ', '<address>', '</address>');
    ?>
	<?php 
} else {
    ?>
		<address><?php 
    the_author();
    ?>
</address>
	<?php 
}
?>

	<!-- The published and last modified time stamps -->
	<time class="op-published" dateTime="<?php 
echo esc_attr(get_the_time('c'));
开发者ID:humanmade,项目名称:Simple-Instant-Articles-for-Facebook,代码行数:31,代码来源:article-cover.php

示例11: esc_html

        esc_html(the_title_rss());
        ?>
</title>
				<link><?php 
        the_permalink_rss();
        ?>
</link>
				<pubDate><?php 
        echo esc_html(mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false));
        ?>
</pubDate>
				<?php 
        if (function_exists('coauthors')) {
            ?>
					<?php 
            coauthors('</dc:creator><dc:creator>', '</dc:creator><dc:creator>', '<dc:creator>', '</dc:creator>');
            ?>
				<?php 
        } else {
            ?>
					<dc:creator><?php 
            the_author();
            ?>
</dc:creator>
				<?php 
        }
        ?>
				<guid isPermaLink="false"><?php 
        esc_html(the_guid());
        ?>
</guid>
开发者ID:humanmade,项目名称:Simple-Instant-Articles-for-Facebook,代码行数:31,代码来源:feed.php

示例12: apn_guest_authors_link

/** gets co-authors link if co-aurhors plugin is installed. 
 *  otherwise, gets the link mannually. 
 *  
 *  @used by: Home-guest-article; apn_guest_authors_meta();
 */
function apn_guest_authors_link()
{
    if (function_exists('coauthors_posts_links')) {
        $poster = get_the_author();
        $author = coauthors(null, null, null, null, false);
        if ($poster != $author) {
            $before = "<span class=\"glyphicon glyphicon-user\"> </span> ";
            return coauthors_posts_links(null, null, $before, null, false);
        } else {
            return false;
        }
    } else {
        return "WP Co-Authors Plus Plugin missing. See https://wordpress.org/plugins/co-authors-plus/";
    }
}
开发者ID:hktang,项目名称:apntwentyfifteen,代码行数:20,代码来源:functions.php


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