Hello — if you’ve been using this plugin for years and are wondering if you can revert back to using regular authors (and convert your existing “bylines” to “authors”) the short answer is “yes.” There are some caveats, however.
Let me know in the replies if interested and we can connect.
I need the byline to show my full name: Liza Horan
I’ve changed the setting to show ‘full name’ yet it will not make the change.
Two questions:
Thank you. I am desperate for some help on this!
Hi. Thanks for creating the Byline plugin–it was just what I was looking for!
My question is, since the comma is used as a delimiter between authors, how do I add suffixes after a person’s name. For instance: John Smith, MD, PhD
This adds the degrees as separate authors and places them in the wrong order. I tried adding the commas using the HTML code, but this didn’t solve the problem.
Thanks!
]]>Bylines do not replace the user assigned author in WordPress.com and Postmatic. I haven’t looked into this, but my guess is that services using the REST API aren’t touched by this plugin.
]]>I have the corrected code as mentioned here – https://www.ads-software.com/support/topic/showing-the-descriptions?replies=2 in my single.php file. But I get this error message in my error log multiple times a day PHP Warning: Invalid argument supplied for foreach() in…
The only foreach in single.php is the code that shows the byline description. Is there better code?
]]>I’m trying to get this to display properly within the underscores theme. It’s been mentioned in previous posts you need to add the_author function in order for bylines to display properly.
For underscores, this means altering the function in template-tags.php. PHP is difficult for me and I’m having a hard time implementing this. What do I need to change this to in order to make bylines display properly?
$byline = sprintf(
esc_html_x( 'by %s', 'post author', 'fff' ),
'<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>'
);
Any help here is appreciated.
]]>First, I want to say that this plugin is a lifesaver. Co-authors was causing me all sorts of issues, and this plugin made things so much easier to work with. So thank you!
I had a question about the hyperlinked byline and where it should link to. On my page, when you click an author’s byline, it should lead you to a page like this (with all of the author’s article and a short bio about them): https://gppreview.com/author/kjohnston/. Usually the hyperlink is gppreview.com/author/”authorname”
However, in some cases, it links to a page like this: https://gppreview.com/byline/laura-wilson/
This page doesn’t have the author’s picture, nor a short bio. And the hyperlink is: gppreview.com/byline/”authorname.” How might I be able to get the bylines that link to /byline to actually link to /author?
Thank you!!
]]>Hello,
First, thank you for an amazing plugin that does just what it says.
One glitch I’ve found is that when I go to page two of my posts-grid, the bylines don’t replace the authors (it works great everywhere else). I suspect this is because page two is dynamically generated (through ajax), and thus not triggering the replacement javascript.
Here’s the site, you can see the error on page two, all bylines are replaced by the default author: https://development.stirjournal.com/
Could someone help me out here, perhaps offer a workaround?
I’d appreciate it a lot.
Hi,
I am facing the problem that many others faced before. My author is displayed as: a href=”https://link to byline” rel=”tag”>name of author</a
As suggested before, I tried to replace the function with the_author but as I am a total beginner, I struggled and horribly failed! Could you tell me if this is the code I need to adjust? (located in template-tag.phps) (I am using the Theme ‘Match’, which basically has no support)
if ( ! function_exists( 'match_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function match_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><span class="byline"> by %2$s</span>', 'match' ),
sprintf( '<a href="%1$s" rel="bookmark">%2$s</a>',
esc_url( get_permalink() ),
$time_string
),
sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s">%2$s</a></span>',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_html( get_the_author() )
)
);
}
endif;
and if possible what I need to change in there to get the result I am looking for?
Thanks in advance for the help!
]]>Great plugin. Question that I can’t figure out: How do I format the tag to include something as simple as “by” in front of the name? And how to place the person’s role as either a “guest author” or “staff” as described in the description. I am a beginner and trying to learn child themes.
]]>What are some of the better recent post display widgets that work well with Byline? The changelog for Byline 0.25 says it “Fixed code to allow byline to appear in widgets” so I am wondering which widgets work well with Byline filtering output for the_author. Many recent post widgets don’t even include the author, such as the “recent posts” widget in the WP core. What is a good test case to use for bylines in widgets?
]]>For the FAQ/Notes:
After activating the Byline plugin you may get 404s when you click on byline names. These links should take you to a term archive for all posts by that author. The reason this fails under some conditions has to due with stale cached data (transients) that need to be flushed. You can flush transients in WP by clicking update within the permalinks settings page. Or use a plugin like this: one https://www.ads-software.com/plugins/artiss-transient-cleaner/
]]>Here is how to generate bylines like:
Author 1 and Author 2
Author 1, Author 2 and Author 3
You can throw in an Oxford comma too if you want:
Author 1, Author 2, and Author 3
There are several ways you could do this within the plugin logic code, but they would complicate the code and mix up logic and presentation more than it already is in WordPress. This simple CSS solution is the best way to go: https://stackoverflow.com/questions/6587807/comma-delimited-lists-with-css-i-want-an-oxford-comma
Only a few minor changes to the existing plugin code will be necessary:
https://codex.www.ads-software.com/Function_Reference/get_the_term_list#Returning_an_HTML_List
The user-author always appears in the author field in the feed output, not the byline-author(s). The plugin code that is supposed to handle this seems to have no effect. What is the intended behavior?
I haven’t messed with feed output in WP in a long time, so I’m doing some reading on this now.
]]>It’s a common practice to append a brief biographical profile about an author at the end of an article. Here are some code snippets that model ways to do this.
As discussed in this thread, here is Matt’s (corrected) code for displaying byline descriptions in a list below a post:
<?php $terms = get_the_terms($post->ID, 'byline');
$count = count($terms);
if ( $count > 0 ){
echo "<ul>";
foreach ( $terms as $term ) {
echo "<h6>About " . $term->name . "</h6>";
echo "<p>" . $term->description . "</p>";
}
echo "</ul>";
}
?>
The following snippet works a little differently. It first checks if the actual user-author has a bio filled out in their user profile. If they do, it’s displayed. Then if there are any byline co-authors with bios, these are put into an array separated by a tag (or whatever you want) and then displayed. This is useful if you’re just using Byline for Co-Authors and still want to use the WP user-author.
<?php if(is_single()) : ?>
<div class="entry-author-bio">
<!-- If Author is User with Bio, display it -->
<?php if ( is_singular() && $author_bio = get_the_author_meta( 'description' ) ) : ?>
<!-- Insert your code for displaying normal user-author bylines here. -->
<?php endif; ?>
<!-- Now get and display any guest-author bylines. -->
<?php global $post;
$terms = get_the_terms($post->id, 'byline');
$guest_author_bio = array();
foreach ($terms as $term) {
$guest_author_bio[] = $term->description;
}
$guest_author_bio = join( "<br> ", $guest_author_bio);
echo $guest_author_bio;
?>
</div>
<?php endif;>
]]>
I want to display the image of the different authors, but now there is no way to upload the image when I create a byline. How can I do this, or there is any other way to solve it.
]]>I’m getting the following for older posts that don’t have a Byline name selected:
“Warning: Invalid argument supplied for foreach() in /home/[username]/public_html/[sitename]/wp-content/themes/twentytwelve-child/content.php on line 53”
Line 53 is the last line of the following
<?php $terms = get_the_terms($post->ID, 'byline');
$count = count($terms);
if ( $count > 0 ){
echo "<ul>";
foreach ( $terms as $term ) {
How do I get rid of this error?
]]>Is there a way to code html into Byline descriptions?
It’d be great to be able to link to author social media profiles and include an avatar photo.
]]>I added this to my single.php, but then it shows all author and descriptions on all pages. Same issue as pwocken.
It’s a test site, but you can see it live here – https://www.hereismysite.info/monster-santa/
<?php //old code here;
//more old code ();
//last line of old code;
//You can add a comment here, to remind you why there is new code below
$terms = get_terms("byline");
$count = count($terms);
if ( $count > 0 ){
echo "
<ul>";
foreach ( $terms as $term ) {
echo "<h6>About " . $term->name . "</h6>";
echo "<p>" . $term->description . "</p>";
}
echo "</ul>
";
}
?>
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
]]>When I use the plugin, instead of the page displaying the authors name, it displays all the code that should be on the page, such as this: <a href="https://newsroom.seattletimes.com/picturethis/byline/bettina-hansen/" rel="tag">Bettina Hansen</a>
Here is an example: https://newsroom.seattletimes.com/picturethis/2013/12/06/a-breath-of-cold-air/
Any idea how a help it perform correctly?
Thanks!
]]>First, I love this plugin right now. Implementing co-authors plus was driving me batty and this is a godsend. Thank you.
A brief question… and please note that while I have a background in SQL and ASP, PHP is not my native language and it’s been a while since I dug into a coding project.
How do I display the description field? At the bottom of my posts, I’d like to loop through each byline and spit out something like:
About Bob Smith
Bob Smith is an awesome guy. He does things and stuff.
About Andrew Anderson
Andrew is the director of important things at large company.
etc.
Assistance is appreciated.
Best,
Dave
Not sure if you can answer this… but I’m trying to use your very helpful byline override to show the byline author on a category post list, using the WP Category Post List plugin. The code that it uses to display the author is
/** Add author? */
$post_output .= ((true == $op[‘show_author’])? ‘ <span class=”wp-cpl-author”>’ . __(‘By ‘, $wp_cat_list_itg_tans) . ‘post_author) . ‘”>’ . get_the_author_meta(‘display_name’, $post->post_author) . ‘</span>’ : ”);
I’ve tried a few things, using the_author and byline in various places, but I’m not very knowledgable with WP’s setup. Do you know how I could do that?
]]>Hello – Thanks so much for this plugin, it’s exactly what I need. I’m wondering if I can remove the link from the author name entirely. I just want to show the name, no link. Is that possible?
Thank you!
]]>I’m using a featured category widget which allows me to display the titles and bylines of my three most recent posts. However, instead of pulling the byline of the listed post, it pulls the most recent byline added.
Any idea why that would happen?
It’s the top left widget here: https://mennoweekly.org/wp/
]]>Goes to a page not found page.. If I can’t figure this out I’ll be back to the drawing board looking for another plugin like this..
]]>We like the premise behind this plug-in, particularly its attempt to provide a solution that doesn’t require modifications to the theme templates.
Unfortunately, we’ve had an issue with the plug-in that is preventing its use. When we add a byline for someone, say Jim Smith, and then publish the post, the author meta data visible under the post title is something like:
Jim Smith”>Jim Smith — May 16, 2013
When I view the source code, I can see how the associated data was processed by the loop:
<span class="the-author"><a href="https://blogurl.com/author/webmaster/" title="<a href=" http:="" blogurl.com="" byline="" jim-smith="" "="" rel="tag">Jim Smith</a>"><a href="https://blogurl.com/byline/jim-smith/" rel="tag">Jim Smith</a> — </span>
I have not been able to determine where the extra <” is coming from. Do you have any ideas?
We’ve had no issues during installation, and are running on WordPress 3.5.1. We’d be delighted to get the plug-in working, as we’re hoping to use this exact functionality in an upcoming blog.
Thanks!
-Joe M