- This topic has 13 replies, 3 voices, and was last updated 4 years, 3 months ago by Leo.
-
AuthorPosts
-
December 16, 2019 at 5:34 pm #1106312Jodie
Hi guys
Iโve just checked the link that the author name directs to and it seems to be an archive page โ
I want this link to direct to the About Page.
How can I do that please?
Cheers
Jodie
December 16, 2019 at 5:51 pm #1106325LeoStaffCustomer SupportHi there,
Do you only have one author in your blog?
Let me know ๐
December 16, 2019 at 5:59 pm #1106334JodieYes it is just me at this stage ๐
December 16, 2019 at 6:13 pm #1106347LeoStaffCustomer SupportTry this PHP snippet:
add_filter( 'generate_post_author_output', function() { printf( ' <span class="byline">%1$s</span>', sprintf( '<span class="byline">%1$s<span class="author vcard" %5$s><a class="url fn n" href="https://LINK-TO-ABOUT-PAGE" title="%3$s" rel="author" itemprop="url"><span class="author-name" itemprop="name">%4$s</span></a></span></span> ', apply_filters( 'generate_inside_post_meta_item_output', '', 'author' ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), /* translators: 1: Author name */ esc_attr( sprintf( __( 'View all posts by %s', 'generatepress' ), get_the_author() ) ), esc_html( get_the_author() ), generate_get_microdata( 'post-author' ) ) ); } );
Adding PHP: https://docs.generatepress.com/article/adding-php/
Make sure to replace
LINK-TO-ABOUT-PAGE
with the actual link.December 16, 2019 at 7:19 pm #1106365JodieThanks very much Leo.
I will try to do as you have suggested and get back to you.
December 16, 2019 at 7:25 pm #1106368JodieHi Leo
It is coming back with this error message for this line
generate_get_microdata( ‘post-author’ )Your PHP code changes were rolled back due to an error on line 35 of file wp-content/themes/generatepress_child/functions.php. Please fix and try saving again.
syntax error, unexpected end of file, expecting ‘,’ or ‘)’
What shall I do?
December 16, 2019 at 7:49 pm #1106379LeoStaffCustomer SupportThat’s weird. I tested the code without any issues:
https://www.screencast.com/t/MrdcweIEmazkWhat happens if you remove your other functions?
December 16, 2019 at 8:03 pm #1106385JodieThank you Leo
I was missing some of the code I realise now.
What happens to that author page that the link was originally linking to?
Where is that now?
Cheers
Jodie
December 16, 2019 at 8:11 pm #1106389JodieCan I ask you this Leo?
With the Publish Date it hyperlinks back to the post you are on.
Why is the date linked, what is the purpose of that?
Cheers
Jodie
December 17, 2019 at 7:10 am #1106906DavidStaffCustomer SupportHi there,
Author pages are generated by a function so the Old Author Page doesn’t really exist unless the function for it is called.
Links on post meta such as the date is just the norm for WordPress.
December 17, 2019 at 5:20 pm #1107334JodieThanks very much David.
So due to the author pages generated by a function, I am assuming that Google doesn’t index that page. Is that right?
Is there a way to remove the link from the date?
Thanks as always for your continued support.
Cheers
Jodie
December 17, 2019 at 6:10 pm #1107360LeoStaffCustomer SupportI believe so. Author archive isn’t very important from my understanding.
Try this snippet for date link:
https://docs.generatepress.com/article/generate_post_date_output/#remove-link-from-dateDecember 18, 2019 at 11:23 am #1108108JodieThanks very much Leo
That snippet worked.
Cheers
December 18, 2019 at 11:32 am #1108116LeoStaffCustomer SupportNo problem ๐
-
AuthorPosts
- You must be logged in to reply to this topic.