jornes
October 18, 2022, 2:05am
1
Bricks Version : 1.5.5
Browser : Chrome 90
OS : macOS / Windows / Linux / etc.
URL : Provide when necessary
Hi!
I have a section for the post’s author on my single post. I want a dynamic data tag that links to the author’s page (not the author’s website). But I don’t see such an option from the dropdown list.
I also tried User ID . In the editor mode, it says it would render as mydomain.com/author/jornes (it’s what I wanted), but it was not doing the same on the front end. It was still pointing to mydomain.com/author
I assume this is not available(or not working correctly). So, I had to use a custom solution to achieve this for the time being.
I wish Bricks could add this(or fix it) so we can avoid such unnecessary tasks. This is good for new(or regular) users.
Any feedback is welcome.
2 Likes
I’ve tested {wp_user_id} and it works on my site:
And on the frontend it works:
I don’t know why it doesn’t work on your site. But thanks for this, I actually didn’t know that wp_user_id renders a link to author page
1 Like
jornes
October 18, 2022, 6:46am
3
@matejmohar
Thanks for checking it out!
It’s great that works for you.
I’m not sure why it didn’t work for me. haha!
Not sure if it’s because all posts are only by one author. Not sure if it works when there are more than one author?
Hi
I want to do the same for author’s single page (bio, name, author’s posts and etc).
How should i do that?
1- we need an archive for all authors
2- when we click on an author, it should be redirected to the author’s page
It will be great if we could choose what to be shown in the link, for example user_name, custom field or user ID
jornes
October 18, 2022, 12:53pm
6
Hey @Mehdimoradi
I will try to answer your queries.
Create a new page with a slug /author
. And create a template and assign it to this page.
Try to use the user id dynamic data(main post above) to see if it works for you. Otherwise, I will provide you with my custom solution.
*by right, it should work, as Matej said it worked well for him.
2 Likes
timmse
October 18, 2022, 3:47pm
7
Hi Jornes,
Try this:
{site_url}/author/{echo:get_the_author()}
get_the_author is a WordPress function that retrieves the public author name. Does that work for you?
Best regards,
timmse
1 Like
jornes
October 18, 2022, 3:51pm
8
Hi! @timmse
Yes. This way worked for me. Thank you!!
Just wondering why the {wp_user_id}
worked for Matej but didn’t work for me.
timmse
October 18, 2022, 4:05pm
9
I have no idea, {wp_user_id} doesn’t make any sense since user and author are two different things
1 Like
jornes
October 18, 2022, 4:08pm
10
Alright. Thanks again! Stefan.
But it would be good if this is achievable with dynamic data(from the dropdown). Many users will ask about it.
1 Like
Thanks guys, yes it’s so necessary to be available as a dynamic tag in bricks
Found this thread with the same challenge. Wanted to drop what I used as solution: