Choice of pay per view ONLY -not daily or monthly FOR ONE OR MORE POSTS

Can I have the choice of paying only per one view and not the daily or monthly subscription, for one or more posts, and the rest follow the general rule? How do I do that? I change my post settings but I cant see how to uncheck the daily or monthly pass?

  • Hakan
    • The Incredible Smush

    Hi,

    Add these codes inside functions.php of your current theme and modify page/post ID’s as required (this sample disables subscription options for posts with ID 1 and 3):

    function ppw_remove_subscriptions( $content ) {
    global $post;
    if ( $post->ID ==1 || $post->ID ==3 ) {
    if ( strpos( $content, '<div class="ppw_or">' ) !== false ) {
    $temp = explode( '<div class="ppw_or">', $content );
    return $temp[0];
    }
    }
    return $content;
    }
    add_filter( 'the_content', 'ppw_remove_subscriptions', 12 );

    Tip: To find to post/page ID, open the post editor and see the post variable in the address bar of the browser, e.g. 1 in:

    http://example.com/wp-admin/post.php?post=1&action=edit

    Cheers,

    Hakan

  • Selene
    • Flash Drive

    Ok thanks!

    It works

    I have to do it manually I suppose….

    I am developing a multisite on the same subject. In case I have one site all only pay per one view posts…. can it work?

    I mean to set the plugin for this site (I guess I will have to use a specific child theme with the custom-functions.php) to get payed only by pay per one view.

    ….and when can we see the pay pal thing? :wink:

    Selene

  • Selene
    • Flash Drive

    Hi Hakan! Happy New Year!!!

    What I was asking was if I want the whole site to have only pay per one view option what would the code be? Not to have to set post ids etc All the site only pay per one view. No daily or monthly option.

    Thank you

    PS it is still not working. HAve you tested it yet with your sandbox account? I tried everything. It wont open the post.

  • Selene
    • Flash Drive

    Hi Tom! Happy New Year! This is a second request in this topic.

    No I dont mean a single one time payment for the content on the whole site.

    I mean all the posts of the site will have only the option of a single one time payment which I will modify accordingly to its value. Exactly the code Hakan wrote but not for post id s but for all posts.

    To exclude the other two options for ALL the site

    Thank you

  • Hakan
    • The Incredible Smush

    Hi Selene,

    Fixed the issue for your website. Please you check it too.

    If you want to use only Pay Per View, just disable Daily Pass and Recurring subscription options.

    If you want to apply it to all posts, then select “Protection for posts” as “Enabled for all posts”.

    If you select “Automatic” method and set excerpt length as zero, then all posts will be protected automatically. Of course you can select another excerpt length if you want to display a few words from the articles.

    Cheers,

    Hakan

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.