Dynamic Content Pulling website URL

Hi, is there a way for the dynamic content to pull in a user’s website URL?
If you look at the sidebar on this URL, you can see that I have the social icons and the Twitter pulls in the right content. But the URL icon doesn’t even though i’ve set the URL to be: {{dc:user:meta user="author" key="url"}}

Thanks!
Esther

Hello Esther,

Thanks for writing in!

Your DC code is incorrect.
Please use this instead:

{{dc:user:meta user="author" key="user_url"}}

Kindly let us know if this works out for you.

Thanks! Is that for the author website?

Hello Esther,

The DC code will display the url of author of the current post or page.

Hope this helps.

Hi, So It doesn’t seem to be working:

https://esther-live-rns-demo.pantheonsite.io/2019/09/18/sixty-years-later-only-frank-lloyd-wright-synagogue-continues-as-work-of-art/

Actually, It’s working fine. But what’s the key for the author archive page?

Hi Esther,

Unfortunately, author posts URL (the archive page) is neither post related meta or user meta. User meta are the data saved on user profile and not related to any Worpdress generated URL. Hence it’s not currently supported by Dynamic Content’s User meta.

But, you can also achieve that with shortcode, for example please add this code to child theme’s functions.php

add_shortcode ('x_author_posts_url', 'x_author_posts_url' );

function x_author_posts_url ( $content, $atts ) {

if ( !isset($atts['ID']) || empty($atts['ID']) ) {

  $author_id = get_the_author_meta( 'ID' );

} else {

  $author_id = $atts['ID'];
  
}

return get_author_posts_url ( $author_id );

}

Then you can simply add [x_author_posts_url] to your post content, you can also add it to the sidebar given you know the author ID like [x_author_posts_url ID="1"]

But this shortcode may not work on builder’s element option like button’s HREF, hence I recommend using this shortcode within text, raw, and content element. An example

<a href="[x_author_posts_url]">View {{dc:user:display_name}}'s posts</a>

Hope this helps :slight_smile:

Ah sweet, thanks so much!

Anytime, Esther :slight_smile:

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.