Archived topic
Can't specify which author archive page will recieve custom header
7 replies · Started by APDWEB MARKETING DIGITAL on June 24, 2020
Hello, GP Friends!
With the elements feature, we are customing the Author's pages with the Header element. Althought, by selecting the rules, we can't specify which author we want that custom header. It'll go to every author within the blog. Here is the struggle: https://i.imgur.com/kLukFsZ.png
I can't put thisng like {{title}} or {{description}} becouse our custom layout goes the autor's picture. Something like this: https://i.imgur.com/xyc1XrE.png
Hope you guys can help us.
Best regards!
Hi there,
This should help:
https://docs.generatepress.com/article/generate_header_element_display/#examples
Hello, Leo! Thanks for the answere.
I'm stuck on the part that I have to insert whoch author I want the header to show on. In the documentation's exemple, your author is just 'Tom'. But my author has 3 names that stands for: "Priscila Gontijo Correa".
I'm not sure if this isn't working becouse of the author's name or otyher thing that i'm missing. Anyways, i'm showing to you what i'm doing:https://i.imgur.com/wpPmouY.png
What am I missing?
Thanks!
Hi there,
is_author() can take the user ID, username or nicename: https://developer.wordpress.org/reference/functions/is_author/
Hi, Tom.
I figured out which is the User ID of my author, but the filter isn't working... Is there anything else I should know about this function filter? Like the numbers 10 and 2 in the return...
Thanks!
The 10 should be the ID of the Element you're targeting.
When editing the Element, its ID should display in the URL of the page.
Let me know :)
Hey, Tom. Thanks for the answere
I can't make it work, though... Please, can you tell me if it is right?
The Element ID in the URL: https://i.imgur.com/Lj5EADu.png
The filter: https://i.imgur.com/51nAUJT.png
Thanks!
Looks good, although you can keep the second 10 as it was.
Can you link me to the author page where this hook is supposed to show?