- This topic has 24 replies, 6 voices, and was last updated 1 year, 7 months ago by
David.
-
AuthorPosts
-
January 9, 2021 at 8:10 am #1612296
David
StaffCustomer SupportHi there,
Code 1 – is a PHP Snippet – this article explains how to add that to the site:
https://docs.generatepress.com/article/adding-php/
Code 2 – needs to be added using a Hook element:
https://docs.generatepress.com/article/hooks-element-overview/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/January 9, 2021 at 11:58 am #1612510Stefan
Hi David,
Thanks for the reply.
What are the setting for the Hook element? Please see the screenshot for the options I am referring to: https://ibb.co/0mYmjRL
Looking forward to your feedback.
Regards,
StefanJanuary 9, 2021 at 12:59 pm #1612544Stefan
Hi David,
1) I tried to add the code (1). See https://prnt.sc/wjwzv4 but it gave me an error (see screenshot of the error: https://prnt.sc/wjx0hy). This is regarding PHP snippet part.
Is there a change in the code that I need to do?
January 9, 2021 at 4:43 pm #1612635Leo
StaffCustomer SupportWhat are the setting for the Hook element? Please see the screenshot for the options I am referring to: https://ibb.co/0mYmjRL
It depends on where you are trying to add the author box. See the visual guide here:
https://docs.generatepress.com/article/hooks-visual-guide/#single-postgenerate_after_entry_content
hook is a common choice.I tried to add the code (1). See https://prnt.sc/wjwzv4 but it gave me an error (see screenshot of the error: https://prnt.sc/wjx0hy). This is regarding PHP snippet part.
The code is missing a closing
}
at the end.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/January 10, 2021 at 6:28 am #1613010Stefan
Hi Leo,
Thank you for the feedback.
I added two co-authors for the following blog post (see link: https://www.lifestyledemocracy.com/how-is-the-revolution-will-not-be-televised-poem-relevant-today-2-2/), but it does not display the code that is supposed to go in the PHP, it displays it as text.
Please see the screenshot.
https://prnt.sc/wkad0wIs there anything that I can do to fix it so both co-author boxes will be displayed?
Regards,
StefanJanuary 10, 2021 at 10:19 am #1613406Leo
StaffCustomer SupportDid you check the execute PHP box in the hook element?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/January 10, 2021 at 4:56 pm #1613731Stefan
Hi Leo,
Yes, I did. I get the same result (see screenshot: https://prnt.sc/wkl9z0). Now, I get both names in the same box, but cannot generate the additional author boxes.
At the moment, I have two separate Hook Elements. Maybe this is the issue.
See screenshot here:
https://prnt.sc/wkl6c4This is hook element #1:
https://prnt.sc/wkl6lyThis is hook element #2:
https://prnt.sc/wkl6tuIt seemed to work for Alvaro. I don’t know why it does not like me π
Hope you can help π Thank you for your support.
January 10, 2021 at 7:10 pm #1613793Elvin
StaffCustomer SupportHi,
This is hook element #2:
https://prnt.sc/wkl6tuThis hook has broken syntax.
You have to replace
{
and}
with the proper PHP tags<?php
and?>
.Try this instead:
<?php if( function_exists('coauthors_posts_links') ) { coauthors_posts_links(); } else{ the_author_posts_link(); } ?>
A wise man once said:
"Have you cleared your cache?"January 11, 2021 at 12:51 am #1613961Stefan
Hi Elvin,
Thank you for the feedback and for the wise advice π
I entered the updated code (now, it works, thank you very much). I also cleared the cache when trying each of the changes πHowever, the second author box is still not displayed. https://prnt.sc/wkt82v
Just for the records, I am only using the plugin “Co Authors Plus.”Do you know how to make both author boxes be displayed?
Regards,
StefanJanuary 11, 2021 at 9:18 am #1614673David
StaffCustomer SupportThe original topic poster ending up using another set of plugins to achieve that… he mentions which one here:
https://generatepress.com/forums/topic/social-links-and-co-authors-in-author-box/#post-1533824
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.