Site logo

Archived topic

Social links and co-authors in author box

24 replies · Started by Álvaro on November 15, 2020

Viewing posts 16–25 of 25

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,
Stefan

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?

What 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-post

generate_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.

Did you check the execute PHP box in the hook element?

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/wkl6c4

This is hook element #1:
https://prnt.sc/wkl6ly

This is hook element #2:
https://prnt.sc/wkl6tu

It seemed to work for Alvaro. I don't know why it does not like me :(

Hope you can help :) Thank you for your support.

Hi,

This is hook element #2:
https://prnt.sc/wkl6tu

This 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(); 
} ?>

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,
Stefan

This archived topic is closed to new replies.