Archived topic
Retrieve User "Website" as dynamic data?
5 replies · Started by John on January 1, 2023
Hi team,
I have user profiles with no custom fields, just the default user profiles. They include a "Website" field, and I would like to use it as dynamic data to display within a template. Can I use GP (or GB) dynamic data for that? If so, how do I retrieve it? Thank you
Hi John,
Yes, you can use it. You can use the GP Dynamic data for instance. Try setting the source to Author Meta, and the field name to user_url. Reference: https://docs.generatepress.com/article/dynamic-data/#author-meta
You can check other user meta field names here: https://developer.wordpress.org/reference/functions/get_the_author_meta/#description
Thanks Fernando!
I think I may have found a bug. I'm able to retrieve the value when using GP Premium's Dynamic Options but not when I'm using GB Pro's Dynamic Data. With the GB metabox, the value seems to be ignored, as if the custom field didn't exist.
The only drawback is that with GP's dynamic options, I don't have the option "Remove block if link is empty", and it's pretty essential in this case. I can't display a button that has no link :/
I see. For reference, can you take a screenshot of your dynamic settings when trying to retrieve it with GB?
Uploading Screenshots: https://docs.generatepress.com/article/using-the-premium-support-forum/#uploading-screenshots
Yes, here it is https://i.imgur.com/VtloqSV.png
It's within an Hero Header Block element
Hi there,
does the button have a static URL eg. just add a # to its URL field.
