Jeremy Varnham
Forum Replies Created
-
Forum: Plugins
In reply to: [Co-Authors Plus] "Posted by" has disappearedIn that case put that back where it was, and then open your theme’s functions.php and find this code:
// Post Author and Date Design function newspress_author_meta() { $archive_year = get_the_time('Y'); $archive_month = get_the_time('m'); $archive_day = get_the_time('d'); ?> <div class="post-author"><span class="post-author"><?php the_author_posts_link(); ?> | </span><span class="post-date"><a href="<?php echo get_day_link( $archive_year, $archive_month, $archive_day); ?>"><?php the_time('F j, Y'); ?></a></span></div> <?php }
You can change the part which says
<?php the_author_posts_link(); ?>
and replace it with<?php if ( function_exists( 'coauthors_posts_links' ) ) { coauthors_posts_links(); } else { the_author_posts_link(); } ?>
Note: I’m basing this upon the free version of the theme you are using. If the code is different in the premium version, then contact the theme author.
Forum: Plugins
In reply to: [Co-Authors Plus] "Posted by" has disappearedJ Craig:
As for the author box at the bottom, your theme is using Fancier Author Box by ThematoSoup. In order to make this work with Coauthors Plus, it would require significant rewriting of that plugin (specifically in ts-fab-construct-tabs.php).
I would recommend asking about this on that plugin’s support forum.
Forum: Plugins
In reply to: [Co-Authors Plus] "Posted by" has disappearedJ Craig:
It depends what code you replaced to implement the coauthor function. Some themes have their own custom functions for the author/date display which are configurable in the backend.
If you’re using the built-in WP functions along with Coauthors Plus, then here’s one way:
if ( function_exists( 'coauthors_posts_links' ) ) { coauthors_posts_links(null,null,'Posted by '); } else { echo 'Posted by'; the_author_posts_link(); } echo ' on '; the_time( get_option( 'date_format' ) );
Forum: Plugins
In reply to: [Co-Authors Plus] CommasAny luck with the RSS?
Forum: Plugins
In reply to: [Co-Authors Plus] CommasAh, I see. I think you inserted that comma in a previous edit. The unmodified line reads:
$default_between_last = ( defined( 'COAUTHORS_DEFAULT_BETWEEN_LAST' ) ) ? COAUTHORS_DEFAULT_BETWEEN_LAST : __( ' and ', 'co-authors-plus' );
Forum: Plugins
In reply to: [Co-Authors Plus] CommasI’m not getting an extra comma with that last code I posted:
https://abuyasmeen.com/jquery-drag-drop-resize-to-fit-target/Are you inserting it with:
<?php coauthors_posts_links(); ?>
?Forum: Plugins
In reply to: [Co-Authors Plus] CommasSorry about that; I didn’t test it ??
This works:
// Append separators if ( ! $i->is_first() && $i->count() > 2 ) $output .= $separators['between']; // Oxford comma fix if ( $i->is_last() && $i->count() > 2 ) { $output = rtrim( $output, $separators['between'] ); $output .= $separators['between'] . $separators['betweenLast']; } elseif ( $i->is_last() && $i->count() > 1 ) { $output = rtrim( $output, $separators['between'] ); $output .= $separators['betweenLast']; }
And use it with the vanilla code.
Forum: Plugins
In reply to: [Co-Authors Plus] CommasAs for the comma being displayed for only two items, this is because it is attached with the “and” in the code we specified.
To get around this, I must again resort to modifying the source.
Open up template-tags.php and find this piece of code at line 164:
// Append separators if ( ! $i->is_first() && $i->count() > 2 ) $output .= $separators['between']; if ( $i->is_last() && $i->count() > 1 ) { $output = rtrim( $output, $separators['between'] ); $output .= $separators['betweenLast']; }
After that code, try add the following lines:
// Oxford comma fix if ( $i->is_last() && $i->count() > 2 ) { $output = rtrim( $output, $separators['between'] ); $output .= $separators['between'] . $separators['betweenLast']; }
And then in the place you inserted the author list in your code, get rid of the extra comma before the “and”.
<?php coauthors_posts_links(', ','and '); ?>
In fact, you could probably just use the vanilla function:
<?php coauthors_posts_links(); ?>
Perhaps the authors could add this as an option somewhere for people who prefer the Oxford comma :-)\
https://www.dropbox.com/s/msst4sqi4zevx2i/Screenshot%202014-11-15%2010.30.50.png?dl=0
Forum: Plugins
In reply to: [Co-Authors Plus] CommasI’m not sure about your first question. I inspected the pipes feed and the Oxford comma is present. Did you already fix that issue?
https://www.dropbox.com/s/abqa33i4kh6d4v8/Screenshot%202014-11-15%2010.08.34.png?dl=0Anyway, I believe the relevant code for RSS is on line 30 of class-coauthors-template-filters.php in the function filter_the_author_rss
$coauthors = (array)get_coauthors();
I don’t see a way to hook into this, so I guess you could try modifying that line in the code directly.
If that doesn’t work, perhaps you could post a new thread with that question.
Forum: Themes and Templates
In reply to: [Hueman] Show multiple authors in byline???You need to replace this:
<?php the_author_posts_link(); ?>
With this:
<?php if ( function_exists( 'coauthors_posts_links' ) ) { coauthors_posts_links(); } else { the_author_posts_link(); } ?>
Forum: Plugins
In reply to: [Co-Authors Plus] All Guest AuthorsHi Neevan,
This outputs a list of co-authors:
<?php coauthors_wp_list_authors(); ?>
Or to override the defaults:
$args = array( 'optioncount' => true, 'show_fullname' => false, 'hide_empty' => false, 'feed' => '', 'feed_image' => '', 'feed_type' => '', 'echo' => true, 'style' => 'list', 'html' => true, 'number' => 30, ); coauthors_wp_list_authors( $args );
Forum: Plugins
In reply to: [Co-Authors Plus] "Posted by" has disappearedYou can put it back like this:
<?php coauthors_posts_links(null,null,'Posted by '); ?>
Forum: Plugins
In reply to: [Co-Authors Plus] Guest author Biographical Info on author.phpHi Tduffy17,
Try something like this:
$coauthors = get_coauthors(); foreach( $coauthors as $coauthor ) { $userdata = get_userdata( $coauthor->ID ); if ( $userdata->display_name ) { echo '<h2>' . $userdata->display_name . '</h2>'; } if ( $userdata->user_description ) { echo '<p>' . $userdata->user_description . '</p>'; }
Forum: Plugins
In reply to: [Co-Authors Plus] CommasHi JT,
You can do it like this:
<?php coauthors_posts_links(', ',', and '); ?>
See the documentation here: Incorporate Co-Authors Plus Template Tags into Your Theme
Jeremy
Forum: Plugins
In reply to: [Co-Authors Plus] Not Working WordPress 4.0?Ditto: 404 or not found on co-author archive page.