本文整理汇总了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
}
}
示例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();
}
}
示例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>';
}
}
示例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;
}
示例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();
?>
示例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
}
?>
示例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
示例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(); ?>
示例9: filter_the_author
function filter_the_author()
{
return coauthors(null, null, null, null, false);
}
示例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'));
示例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>
示例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/";
}
}