Good afternoon,
I have one more question. I use the co-author plugin to add multiple authors to a post. All these authors link to an author-page. But I also need to add authors without a link to an author-page. For that I made a custom field where I can add other authors. But sometimes I only need an author without a page-link, but I always have to add an author in co-author, so I want to replace the author:”admin” with the author from the custom field. I want to replace it because if there are more authors with a link, they have to show also.
So I have now:
if(get_field('guest_author')){
echo '<span class="guest-author" style="display:inline;"> ' . get_field('guest_author') . ', </span>';
}
coauthors_posts_links();
I tried something like this:
if (the_author('admin')){
echo '<span class="guest-author" style="display:inline;"> ' . get_field('guest_author') . ' </span>';
}
else {
coauthors_posts_links();
}
but it does not replace the author:”admin”
It would be great if you could give me a hand. Thanks already!
Hey InekeWerkt!
Unfortunately your request falls outside the scope of the basic theme support.
In my opinion though, you should get_the_author
instead of the_author to get the author name and place it in a variable then compare.
Alternatively, you might need to find a plugin or hire a freelance developer to add the feature for you. Please visit Envato Studio or WordPress for further customization. You can also vote or post the feature on our https://kriesi.at/support/enfold-feature-requests/ page.
If you have any further questions about the theme, we are more than happy to provide you with assistance on these inquiries. Thank you for your understanding.
Cheers!
Arvish