本文整理汇总了PHP中coauthors_posts_links函数的典型用法代码示例。如果您正苦于以下问题:PHP coauthors_posts_links函数的具体用法?PHP coauthors_posts_links怎么用?PHP coauthors_posts_links使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了coauthors_posts_links函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: cb_get_byline
function cb_get_byline($post)
{
$cb_meta_onoff = ot_get_option('cb_meta_onoff', 'on');
$cb_byline_author = ot_get_option('cb_byline_author', 'on');
$cb_byline_date = ot_get_option('cb_byline_date', 'on');
$cb_byline_category = ot_get_option('cb_byline_category', 'on');
$cb_prefix = __('Written by', 'cubell');
$cb_byline_author_prefix = ot_get_option('cb_byline_author_prefix', 'Written by');
if ($cb_byline_author_prefix != 'Written by') {
$cb_prefix = $cb_byline_author_prefix;
}
$cb_byline_sep = '<span class="cb-separator">' . ot_get_option('cb_byline_separator', '<i class="fa fa-times"></i>') . '</span>';
$cb_byline = $cb_cat_output = $cb_date = $cb_author = NULL;
$cb_post_id = $post->ID;
if ($cb_byline_author != 'off') {
$cb_author = '<span class="cb-author">' . $cb_prefix;
if (function_exists('coauthors_posts_links')) {
$cb_author .= ' ' . coauthors_posts_links(null, null, null, null, false);
} else {
$cb_author .= ' <a href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . get_the_author() . '</a>';
}
$cb_author .= '</span>';
if ($cb_byline_category != 'off' || $cb_byline_date != 'off') {
$cb_author .= $cb_byline_sep;
}
}
if ($cb_byline_date != 'off') {
$cb_date = '<span class="cb-date"><time class="updated" datetime="' . get_the_time('Y-m-d', $cb_post_id) . '">' . date_i18n(get_option('date_format'), strtotime(get_the_time("Y-m-d", $cb_post_id))) . '</time></span>';
if ($cb_byline_category != 'off') {
$cb_date .= $cb_byline_sep;
}
}
if ($cb_byline_category != 'off') {
$cb_cats = get_the_category($cb_post_id);
if (isset($cb_cats)) {
$cb_cat_output = ' <span class="cb-category">';
$i = 1;
foreach ($cb_cats as $cb_cat) {
if ($i != 1) {
$cb_cat_output .= ', ';
}
$cb_cat_output .= ' <a href="' . esc_url(get_category_link($cb_cat->term_id)) . '" title="' . esc_attr(sprintf(__("View all posts in %s", "cubell"), $cb_cat->name)) . '">' . $cb_cat->cat_name . '</a>';
$i++;
}
$cb_cat_output .= '</span>';
}
}
if ($cb_meta_onoff == 'on') {
$cb_byline = '<div class="cb-byline">' . $cb_author . $cb_date . $cb_cat_output . '</div>';
}
return $cb_byline;
}
示例3: 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;
}
示例4: filter_the_author_posts_link
function filter_the_author_posts_link()
{
return coauthors_posts_links(null, null, null, null, false);
}
示例5: the_byline_front
function the_byline_front($displayBy = true)
{
global $post, $authordata, $wpdb;
$authorid = $post->post_author;
$articleFormats = wp_get_post_terms($post->ID, 'article-format');
if (isset($articleFormats[0])) {
$articleFormat = $articleFormats[0]->slug;
}
if (empty($articleFormat) || $articleFormat === 'normal') {
$articleFormat = get_field('db_article_format');
}
if ($authorid == 0 || !isset($authorid) || $articleFormat == "brief" || get_field('db_article_format') == 'default' && in_array('hide_byline', get_field('db_display_options'))) {
return false;
}
// Get coauthors
ob_start();
coauthors_posts_links();
$coauthors = ob_get_contents();
ob_end_clean();
// Code modified from WordPress core, wp-includes/author-template.php
$by = "By ";
if (!$displayBy) {
$by = "";
}
$link = '<h5 style="text-transform:uppercase">' . $by . $coauthors . '</h5>';
echo apply_filters('the_byline', $link);
}
示例6: coauthors_author_info
/**
* Check if the Co-Authors PLus plugin is enabled for multi-author support
**/
function coauthors_author_info()
{
if (function_exists('coauthors_posts_links')) {
coauthors_posts_links();
} else {
the_author_posts_link();
}
}
示例7: zerif_posted_on
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function zerif_posted_on()
{
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>';
if (get_the_time('U') !== get_the_modified_time('U')) {
$time_string .= '<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()));
printf(__('<span class="posted-on">Posted on %1$s</span><br><span class="byline"> by %2$s</span>', 'zerif-lite'), sprintf('<a href="%1$s" rel="bookmark">%2$s</a>', esc_url(get_permalink()), $time_string), coauthors_posts_links(null, null, null, null, false));
}
示例8: be_post_authors_post_link_shortcode
/**
* Post Authors Post Link Shortcode
*
* @author Bill Erickson
* @link http://www.billerickson.net/wordpress-post-multiple-authors/
*
* @param array $atts
* @return string $authors
*/
function be_post_authors_post_link_shortcode($atts)
{
$atts = shortcode_atts(array('between' => null, 'between_last' => null, 'before' => null, 'after' => null), $atts);
$authors = function_exists('coauthors_posts_links') ? coauthors_posts_links($atts['between'], $atts['between_last'], $atts['before'], $atts['after'], false) : $atts['before'] . get_author_posts_url() . $atts['after'];
return $authors;
}
示例9: the_title
<?php
} else {
?>
<header class="article-header">
<?php
}
?>
<h1 class="entry-title single-title" itemprop="headline"><?php
the_title();
?>
</h1>
<p class="byline vcard">
<?php
if (function_exists('coauthors_posts_links')) {
printf(__('<span class="author">%3$s</span> <time class="updated" datetime="%1$s">%2$s</time>', 'bonestheme'), get_the_time('Y-m-j'), get_the_time(get_option('date_format')), coauthors_posts_links(null, null, 'By ', null, false));
} else {
printf(__('<span class="author">%3$s</span> <time class="updated" datetime="%1$s">%2$s</time>', 'bonestheme'), get_the_time('Y-m-j'), get_the_time(get_option('date_format')), the_author_posts_link());
}
?>
</p>
</header>
<?php
// end article header
?>
<section class="entry-content cf" itemprop="articleBody">
<?php
// the content (pretty self explanatory huh)
the_content();
示例10: cb_get_byline
function cb_get_byline($cb_post_id, $cb_cat = NULL, $cb_is_post = NULL, $cb_views_on = NULL, $cb_override = NULL)
{
$cb_meta_onoff = ot_get_option('cb_meta_onoff', 'on');
$cb_byline_author = ot_get_option('cb_byline_author', 'on');
$cb_byline_date = ot_get_option('cb_byline_date', 'on');
$cb_post_meta_views = ot_get_option('cb_byline_postviews', 'on');
$cb_byline_sep = '<span class="cb-separator">' . ot_get_option('cb_byline_separator', '<i class="fa fa-times"></i>') . '</span>';
$cb_byline = $cb_date = $cb_author = $cb_cat_output = $cb_author_avatar = $cb_views_output = NULL;
$cb_post_meta_category = ot_get_option('cb_byline_category', 'on');
if ($cb_byline_author != 'off') {
if ($cb_is_post == true) {
$cb_author_avatar = apply_filters('cb_byline_avatar', get_avatar(get_post_field('post_author', $cb_post_id), 20), $cb_post_id);
}
if (ot_get_option('cb_byline_author_av', 'on') == 'off') {
$cb_author_avatar = NULL;
}
if (function_exists('coauthors_posts_links')) {
$cb_author = apply_filters('cb_byline_coauthors', '<span class="cb-author"> ' . coauthors_posts_links(null, null, $cb_author_avatar, null, false) . '</span>', $cb_author_avatar);
} else {
$cb_author = apply_filters('cb_byline_author', '<span class="cb-author"> <a href="' . esc_url(get_author_posts_url(get_post_field('post_author', $cb_post_id))) . '">' . $cb_author_avatar . get_the_author_meta('display_name', get_post_field('post_author', $cb_post_id)) . '</a></span>', $cb_post_id, $cb_author_avatar);
}
if ($cb_byline_date != 'off') {
$cb_author .= $cb_byline_sep;
}
}
if ($cb_byline_date != 'off') {
//$cb_date = apply_filters( 'cb_byline_date', '<span class="cb-date"><time class="updated" datetime="' . get_the_time('Y-m-d', $cb_post_id) . '">' .human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' ago' . '</time></span>', $cb_post_id );
$cb_date = apply_filters('cb_byline_date', '<span class="cb-date"><time class="updated" datetime="' . get_the_time('Y-m-d', $cb_post_id) . '">' . date_i18n(get_option('date_format'), strtotime(get_the_time("Y-m-d", $cb_post_id))) . '</time></span>', $cb_post_id);
}
if ($cb_cat != NULL) {
if ($cb_post_meta_category != 'off') {
$cb_cats = get_the_category($cb_post_id);
if (!empty($cb_cats)) {
foreach ($cb_cats as $cb_cat => $cb_current_cat) {
if ($cb_byline_date != 'off' || $cb_byline_author != 'off') {
$cb_cat_output .= $cb_byline_sep;
}
$cb_cat_output .= apply_filters('cb_byline_category', '<span class="cb-category cb-element"><a href="' . esc_url(get_category_link($cb_current_cat->term_id)) . '" title="' . esc_attr(sprintf(__("View all posts in %s", "cubell"), $cb_current_cat->name)) . '">' . $cb_current_cat->cat_name . '</a></span>', $cb_current_cat);
}
}
}
}
if ($cb_views_on != NULL) {
if ($cb_post_meta_views != 'off') {
$cb_view_count = cb_get_post_viewcount($cb_post_id);
if ($cb_view_count != NULL) {
if ($cb_byline_date != 'off' || $cb_byline_author != 'off' || $cb_post_meta_category != 'off') {
$cb_views_output .= $cb_byline_sep;
}
$cb_views_output .= apply_filters('cb_byline_views', '<span class="cb-views cb-element">' . $cb_view_count . '</span>', $cb_view_count);
}
}
}
if ($cb_meta_onoff == 'on' || $cb_override == 'on') {
$cb_byline = '<div class="cb-byline">' . apply_filters('cb_byline_start', '') . $cb_author . $cb_date . $cb_cat_output . $cb_views_output . apply_filters('cb_byline_end', '') . '</div>';
}
return $cb_byline;
}
示例11: bild_func
function bild_func( $atts ) {
extract( shortcode_atts( array(
'image_url' => 'Bild wird nicht richtig angezeigt',
'background_position' => 'top',
'type' => 'night',
'text_shadow' => '#e74c3c',
'main_info' => 'Основная информация о проекте',
'header_subtext' => 'Помните, в конце января 2014 года было адовое муниципальное собрание, где мы согласовывали реконструкцию сквера? Наверняка нет. Я писал об этом тут. Там прямо на собрании разгорелись дебаты. Я хотел устроить в сквере побольше точек притяжения для разных возрастов.',
), $atts ) );
$image = wp_get_attachment_image_src($image_url, 'full');
if($type == 'night' || $type == 'Ночь')
$textColor = 'white';
else
$textColor = 'black';
set_query_var( 'textColor', $textColor );
global $post;
$post_type = get_post_type_object($post->post_type);
?>
</div>
</article>
</div>
</div>
<div class="container-fluid fancy" style="margin-top:-65px; margin-bottom:65px;">
<div class="fancy-title" style="min-height:500px; background: url('<?= $image[0] ?>'); background-position: <?= $background_position ?> center; background-size:cover;">
<div class="fancy-title--mask"></div>
<div class="container-size fancy-fix">
<header>
<div class="header row">
<?php get_template_part( 'template-parts/header', 'top' ); ?>
</div>
<div class="header row">
<?php get_template_part( 'template-parts/header', 'logo-fancy' ); ?>
</div>
</header>
<div class="article row">
<div class="article__breadcrumbs row">
<ul class="col-md-12">
<li><a href="/">Главная</a></li>
<li><a href="<? the_permalink() ?>"><? the_title() ?></a></li>
</ul>
</div>
<? if($post_type->labels->singular_name != 'Запись'): ?>
<div class="article__tags row">
<p class="col-md-12 col-sm-12 col-xs-12" style="color: <?= $textColor ?>;"><?= $post_type->labels->singular_name ?></p>
</div>
<? endif; ?>
<div class="article__title-wrapper row">
<div class="article__title col-md-8 col-sm-12 col-xs-12">
<h1 style="color: <?= $textColor ?>; text-shadow: 5px 5px 0px #e74c3c;"><? the_title() ?></h1>
<h3 style="color: <?= $textColor ?>;"><? the_secondary_title() ?></h3>
<h2><?= $main_info ?></h2>
<p><?= $header_subtext ?></p>
</div>
<div class="article__meta col-md-pull-right col-sm-pull-left col-md-offset-2 col-md-2" style="text-shadow: 1px 1px 0px black;">
<p class="article__meta-author-title">Над проектом работали:</p>
<p class="article__meta-author" style="color: <?= $textColor ?>; text-shadow: 1px 1px 0px #e74c3c;">
<? if ( function_exists( 'coauthors_posts_links' ) ) {
coauthors_posts_links(', ',' и ');
} else {
the_author_posts_link();
} ?>
</p>
<p><span class="article__meta-time"><?php echo get_the_time(); ?>,</span> <span class="article__meta-date"><?php echo get_the_date(); ?></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container-fluid container-size">
<article>
<div class="article__content article__content-text">
<div>
<?
return "";
}
示例12: get_bloginfo
</div>
<?php
}
?>
<div class="sidebar-section">
<h2 class="smalltitle">
<?php
//Autor(en)
echo '<img src="' . get_bloginfo('template_directory') . '/images/author16px.png" alt="autor"/> ';
$authors = new CoAuthorsIterator();
print $authors->count() == 1 ? 'Der Autor' : 'Die Autoren';
?>
</h2>
<ul class="smalltext authors">
<?php
coauthors_posts_links('</li><li>', '</li><li>', '<li>', '</li>');
?>
</ul>
</div>
<div class="sidebar-section">
<h2 class="smalltitle"><?php
echo '<img src="' . get_bloginfo('template_directory') . '/images/calendar16px.png" alt="kalender"/> ';
?>
Datum</h2>
<?php
//Datum
echo '<p class="smalltext">Erschienen am ' . get_the_time('j. F Y H:i') . '<br/>';
//Monatsarchiv
echo '<a href="' . get_month_link(get_the_time('Y'), get_the_time('n')) . '">» zum Monats-Archiv</a></p>';
?>
</div>
示例13: twentyten_posted_on
/**
* Prints HTML with meta information for the current post-date/time and author.
*
* @since Twenty Ten 1.0
*/
function twentyten_posted_on()
{
/* if(get_the_tags()!='')
{
printf( __( '<span class="%1$s">,</span>%2$s | Author: %3$s', 'twentyten' ),
'meta-prep meta-prep-author',
get_the_category_list( ', ' ),
sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="">%3$s</a></span>',
get_author_posts_url( get_the_author_meta( 'ID' ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'twentyten' ), get_the_tag_list() ) ),
get_the_tag_list()
)
);
}
else
{*/
the_terms($post->ID, 'edition', '<i>Section: </i>', ', ', ' ');
printf(__('<span class="%1$s">, </span>%2$s | Author: %3$s', 'twentyten'), 'meta-prep meta-prep-author', get_the_category_list(', '), sprintf('<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>', get_author_posts_url(get_the_author_meta('ID')), esc_attr(sprintf(__('View all posts by %s', 'twentyten'), get_the_author())), coauthors_posts_links()));
/*}*/
}
示例14: the_title
?>
"><?php
the_title();
?>
</a></h2>
<h4><?php
the_field("subtitle");
?>
</h3>
<div class="byline">
<div class="featured-text-byline">
<?php
if (function_exists('coauthors_posts_links')) {
?>
By <?php
coauthors_posts_links('display_name');
} else {
?>
By <?php
get_the_author();
}
?>
</div>
<a href=""><i class="fa fa-facebook-official"></i></a>
<a href="https://twitter.com/share?text=<?php
the_title();
?>
" target="_blank" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
<i class="fa fa-twitter-square"></i>
</a>
</div>
示例15: 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/";
}
}