Feature request: Pay With A Like plugin template tags out side the loop

This plugin would justify my $420 annual subscription if it could utilize template tags outside the loop.

  • Hakan
    • The Incredible Smush

    Hi dubya,

    Please create a new post and include your content inside the editor. Set Pay With a Like settings for the post (Enabled, method: Selection tool). Use the Selection tool button to wrap your protected content (If you want you can protect all of the content of course). Post title is not important.

    Save the post as *draft*. Write down the post ID.

    Now edit your template. You can include these codes anywhere you wish. It can even be the footer, for example:

    $post_id = 7; // Change this 7 with your actual Post ID
    $post = get_post( $post_id );
    if ( function_exists( 'wpmudev_pwal' ) )
    echo wpmudev_pwal( $post->post_content, true );

    That's it. If you meet any difficulties during this application please contact me via my email hakan (at) incsub.com


    Edit: Typo fixed.

  • Hakan
    • The Incredible Smush

    Hi dubya,

    Sorry, there is a typo here:

    function exists should be function_exists

    Another thing is normally Pay With a Like works with W3T, but it has not been tested in such a template customization. So please deactivate it first. If everything is ok then you activate it and see the results.


  • dubya
    • The Incredible Code Injector

    Oh man!
    I actually jumped for joy :slight_smile:

    Oh, well. Thank you very much for trying.
    So I guess my feature request is to enable the protection of php codes? lol
    Perhaps a more intuitive way to implement it too, eh?

    Thanks again

  • Hakan
    • The Incredible Smush

    Hi dubya,

    Pay With a Like is designed to work for "protecting posts/pages or parts of posts/pages until visitor likes the protected content with Facebook, Linkedin, Twitter or Google +1. "

    What you are asking is a custom conditional function that will only work when a like button is clicked. It is far beyond the scope and purpose of this plugin

    You may have a look at our social marketing plugin:

    It protects the *full page* until it is liked. So you won't need to have such a conditional function.

    If Social Marketing doesn't help, you can try one of the followings. But we cannot give a guarantee or support on options 2 and 3:

    1. Try to achieve your goal with fixed content inside the post content (Best option).
    2. Try to create your own custom function taking the plugin as an example (Difficult, may require a developer to be hired)
    3. Try to use php eval function instead of echo on the above example. But please note that what is included in the protected content should be valid php code, not part of it for example. (Not recommended and difficult, may require a developer to be hired).
    For details see :


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.