# Lock "custom" content

**URL:** <https://www.patreondevelopers.com/t/lock-custom-content/1289>\
**Category:** Wordpress Plugin\
**Created:** [November 12, 2018, 2:13am UTC](https://www.patreondevelopers.com/t/lock-custom-content/1289 "2018-11-12T02:13:39Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![matt3](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/matt3/32/725_2.png) [@matt3](https://www.patreondevelopers.com/u/matt3)\
**Post date:** [November 12, 2018, 2:13am UTC](https://www.patreondevelopers.com/t/lock-custom-content/1289/1 "2018-11-12T02:13:39Z")

</div>

Currently I am only able to lock the post contents. However, the wordpress theme I am using has a “custom header”. When I lock a post only the post is locked but not the content in my “custom header”.

I am using this to lock podcast episodes. The actual podcast audio file is locked in a “custom header”. What php do I need to edit to lock additional content that is displayed on the page?

---

<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:** [November 12, 2018, 2:38am UTC](https://www.patreondevelopers.com/t/lock-custom-content/1289/2 "2018-11-12T02:38:04Z")

</div>

Yes, this is a frequent situation - and there is a solution for it.

By wrapping any part of your theme in the below code, you can lock that part for any $ level you want. Ie, in your case, you would need to wrap whatever outputs your podcast listing inside the code given below:

> **[Patreon WordPress - how to lock any part of your Website](https://paper.dropbox.com/doc/Patreon-WordPress-how-to-lock-any-part-of-your-Website--ARmQ625uim5Em0FKUkRH6JSeAg-dqneEVjvuYrPbkEJfOuhG)**
>
> How to lock any section, page, type of content, or template section through the code

---

<div class="post-metadata">

**Author:** ![matt3](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/matt3/32/725_2.png) [@matt3](https://www.patreondevelopers.com/u/matt3)\
**Post date:** [November 14, 2018, 12:58am UTC](https://www.patreondevelopers.com/t/lock-custom-content/1289/3 "2018-11-14T00:58:22Z")

</div>

Awesome! I did not know this existed, thank you!

---

<div class="post-metadata">

**Author:** ![blindwave](https://avatars.discourse-cdn.com/v4/letter/b/5f8ce5/32.png) [@blindwave](https://www.patreondevelopers.com/u/blindwave)\
**Post date:** [November 28, 2018, 7:15pm UTC](https://www.patreondevelopers.com/t/lock-custom-content/1289/4 "2018-11-28T19:15:29Z")

</div>

Is there any way for this to work on the per page amount? For example I’m trying to use the VideoPro theme by Cactus themes. In the header of the video post is the embeded video which is not locked via the Patreon plugin even though I have an amount set.

I only want some videos on the site locked.

However, if I put the above code in the header code, won’t it lock all videos under a fixed amount?

Thanks.

---

<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:** [November 28, 2018, 7:19pm UTC](https://www.patreondevelopers.com/t/lock-custom-content/1289/5 "2018-11-28T19:19:22Z")

</div>

Yes the above code would lock all videos. However, you can introduce a post id check to the conditionals to make the code lock only certain posts.

Ie, if the video post’s ids are 356 and 851, check if the current post id is either of them, and if so, allow the lock code.

---

<div class="post-metadata">

**Author:** ![blindwave](https://avatars.discourse-cdn.com/v4/letter/b/5f8ce5/32.png) [@blindwave](https://www.patreondevelopers.com/u/blindwave)\
**Post date:** [November 28, 2018, 7:24pm UTC](https://www.patreondevelopers.com/t/lock-custom-content/1289/6 "2018-11-28T19:24:58Z")

</div>

Could it work on some kind of wildcard? Like if the post title has ‘Early Access’ or ‘Full Length’ in the title for example? Setting individual post id’s is impractical because we are talking hundreds of posts.

---

<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:** [November 28, 2018, 7:36pm UTC](https://www.patreondevelopers.com/t/lock-custom-content/1289/7 "2018-11-28T19:36:59Z")

</div>

Surely, it can work on any conditional you can put into PHP code there.

In this case you can check for post titles, and if titles have certain keywords, you can kick the code in. Or, check the post category, and if it is from a certain category, activate the code etc.

---

<div class="post-metadata">

**Author:** ![blindwave](https://avatars.discourse-cdn.com/v4/letter/b/5f8ce5/32.png) [@blindwave](https://www.patreondevelopers.com/u/blindwave)\
**Post date:** [November 28, 2018, 8:45pm UTC](https://www.patreondevelopers.com/t/lock-custom-content/1289/8 "2018-11-28T20:45:02Z")

</div>

Will this also work with the Patreon Pro plugin? After disabling the normal Patreon plugin, it seemed to break it.

---

<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:** [November 28, 2018, 11:04pm UTC](https://www.patreondevelopers.com/t/lock-custom-content/1289/9 "2018-11-28T23:04:00Z")

</div>

If you disable Patreon WordPress or Patron Button and Widgets, Patron Pro cannot work.

If all 3 are enabled, this code should still work normally as it is.
