- This topic has 13 replies, 3 voices, and was last updated 1 year, 1 month ago by
Leo.
-
AuthorPosts
-
December 16, 2019 at 5:34 pm #1106312
Jodie
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 #1106325Leo
StaffCustomer SupportHi there,
Do you only have one author in your blog?
Let me know π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 16, 2019 at 5:59 pm #1106334Jodie
Yes it is just me at this stage π
December 16, 2019 at 6:13 pm #1106347Leo
StaffCustomer 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.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 16, 2019 at 7:19 pm #1106365Jodie
Thanks very much Leo.
I will try to do as you have suggested and get back to you.
December 16, 2019 at 7:25 pm #1106368Jodie
Hi 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 #1106379Leo
StaffCustomer SupportThat’s weird. I tested the code without any issues:
https://www.screencast.com/t/MrdcweIEmazkWhat happens if you remove your other functions?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 16, 2019 at 8:03 pm #1106385Jodie
Thank 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 #1106389Jodie
Can 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 #1106906David
StaffCustomer 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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 17, 2019 at 5:20 pm #1107334Jodie
Thanks 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 #1107360Leo
StaffCustomer 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-dateDocumentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 18, 2019 at 11:23 am #1108108Jodie
Thanks very much Leo
That snippet worked.
Cheers
December 18, 2019 at 11:32 am #1108116Leo
StaffCustomer SupportNo problem π
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.