- This topic has 7 replies, 3 voices, and was last updated 3 years, 1 month ago by
David.
-
AuthorPosts
-
February 12, 2023 at 3:33 am #2530152
Adam
I’ve set up an author bio area, but I want to link the three dots to the URL that is linked to the author in their bio – not to their other posts.
I’ve looked at various code snippets etc but can’t seem to fathom it out myself.It would also be good if there is any way to implement something like ‘Visit them at XXXX’ too if doable?
February 12, 2023 at 11:42 am #2530612Ying
StaffCustomer SupportHi Adam,
How do you store the URL? Is it a custom field attached to the user or the WP default website field in the user profile?
Let me know!
February 13, 2023 at 2:07 am #2531131Adam
Hiya,
The link is in the private info box for the original post, can you see it?This is the code I’m using for the author box:
.author-box { padding: 3%; padding-bottom: 10px; margin-top: 30px; font-size: 0.9em; background-color: #fff; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; box-shadow: 0 9px 28px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22); } .author-box .avatar { width: 200px; height: auto; border-radius: 100%; margin-right: 30px; } h5.author-title { margin-bottom: 0.1em; font-weight: 600; } .author-description { line-height: 1.6em } .author-links a { margin-top: -1.5em; font-size: 2em; line-height: 2em; float: left; } @media (max-width: 768px) { .author-box { padding: 20px; padding-bottom: 25px; margin-top: 60px; flex-direction: column; text-align: center; } .author-box .avatar { margin-right: 0; width: 100%; margin-top: -25px; } .author-box .avatar img { max-width: 100px; } .author-links a { float: none; align-self: center; } .author-description { margin-bottom: -0.1em; } }February 13, 2023 at 3:27 am #2531225David
StaffCustomer SupportHi there,
how was the author box added to your site ?
Is it using PHP/HTML in a hook element for exampleFebruary 13, 2023 at 4:34 am #2531297Adam
Ah sorry!
I followed this guide here adding a new hook in elements.https://www.wplogout.com/add-author-box-in-generatepress-theme/
February 13, 2023 at 9:41 am #2531814David
StaffCustomer SupportProblem with using that code is the blogger didn’t write the code, so he can’t support it.
This line is what outputs the link:
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" title="Read more">...</a>try changing it to:
<a href="<?php echo get_the_author_meta( 'url', get_the_author_meta( 'ID' ) ); ?>" title="Read more">...</a>Or instead you can build your own author box using a Block Element
February 14, 2023 at 1:22 am #2532529Adam
Thanks that works great!
February 14, 2023 at 3:32 am #2532668David
StaffCustomer SupportGlad to hear that
-
AuthorPosts
- You must be logged in to reply to this topic.