Hide video with Pay with a like

How can I hide a video with pay with a like? Then once the user likes my page, they get to view the video.

  • Hakan

    Hi Timothy,

    I talked to wptimo in the Live Chat. What he requires is using Pay With a Like for a video whose html code is generated by theme options.


    Pay With a Like is designed to modify, i.e. hide and reveal upon Like, post or page content. But, it is possible to adapt it to your case. What you need is copying video html code to a page and modify your template.

    To give an example let's suppose that there is a function "generate_homepage_video()" which outputs video html on the homepage. So your homepage template has a php code like this:


    Let's assume that this function generates an html output like this:

    <iframe width="560" height="315" src="http://www.youtube.com/embed/-uiN9z5tqhg" frameborder="0" allowfullscreen></iframe>

    Now, please follow these steps:

    1. Create a new page and paste the above html code in the editor.
    2. Switch to HTML view and make the following changes:

    replace &gt";" with >
    replace &lt";" with <
    please ignore quotes, I put them because it is not displayed correctly otherwise.

    3. Enable Pay With a Like for the page
    4. Choose method "Selection Tool"
    5. Wrap the html content using Selection Tool icon. The result should be as seen in the attached screenshot.
    6. Save the page in draft mode. We are doing this, because we don't want the page to be displayed in page list. We are just interested in its content. BTW title of the page is not important.
    7. Write down the ID of the page which is revealed after save. In our example we assume it is 7.
    8. In Pay With a Like settings select yes for "Enable on the home page"
    9. Now edit your template which displays the video using the supposed generate_homepage_video() function:

    if ( function_exists( 'wpmudev_pwal' ) ) {
         $post_id = 7;
         $page = get_post( $post_id );
         echo wpmudev_pwal( $page->post_content );

    Now Pay With a Like will protect the video if it is activated. If not, your video will be displayed as before.

    If any part is unclear, please do not hesitate to ask.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.