# How to display the Patreon post's URL in a WordPress post

**URL:** https://www.patreondevelopers.com/t/how-to-display-the-patreon-posts-url-in-a-wordpress-post/6799
**Category:** Wordpress Plugin
**Created:** [January 3, 2023, 6:10am UTC](https://www.patreondevelopers.com/t/how-to-display-the-patreon-posts-url-in-a-wordpress-post/6799 "2023-01-03T06:10:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jennbriden](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/jennbriden/32/1583_2.png) [@jennbriden](https://www.patreondevelopers.com/u/jennbriden)
#### Post date: [January 3, 2023, 6:10am UTC](https://www.patreondevelopers.com/t/how-to-display-the-patreon-posts-url-in-a-wordpress-post/6799/1 "2023-01-03T06:10:40Z")

</div>

I want to double-check that my logic is sound before I code this in with my child theme editor - it seems fairly straightforward. I’d like guidance and any suggestions - I’m learning PHP and know that I could have made some mistakes. 🙂

Edit: Inspiration came from [this post from 2021](https://www.patreondevelopers.com/t/link-back-to-original-patreon-post/4271).

**Goal**  
For a post sync’ed to WordPress from Patreon: display the URL for the original Patreon post as a link within the WordPress post. My client wants to make it easy for people to get back to Patreon from WordPress (and vice-versa).

**Approach**  
I have created a child theme for my customizations. I will update the theme to call the get\_post\_meta function to retrieve the patreon-post-url custom field. This custom field is populated for a post when it is synchronized with the WordPress plugin. (I am not sure if this field is from the free WordPress plugin or the Patron Pro plugin. I use Pro.)

**Edit the functions.php file to retrieve the value of the custom field when the page loads.**

```auto
$patreon_url_field = get_post_meta( get_the_ID(), 'patreon-post-url', true );
$full_patreon_post_url = 'https://patreon.com/<MY_CLIENTS_PAGE>/posts' . $patreon_url_field;
echo $full_patreon_post_url;

```

**And I will add this to the single blog page template so that the URL shows up there.**  
`<a href="<?php echo $full_patreon_post_url; ?>">Posted on Patreon</a>`

---

<div class="post-metadata">

### Author: ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)
#### Post date: [January 4, 2023, 2:17am UTC](https://www.patreondevelopers.com/t/how-to-display-the-patreon-posts-url-in-a-wordpress-post/6799/2 "2023-01-04T02:17:45Z")

</div>

The url format should be

[https://www.patreon.com/posts/some-seo-string-POST-ID](https://www.patreon.com/posts/some-seo-string-POST-ID)

for an individual post. So you will likely need to make the format fit that. [patreon.com/posts/XXXX](http://patreon.com/posts/XXXX) with the post id also works.
