How do I customize Pay Per View to protect Revolution Sliders in header of Avada theme?

Hi there,

I don't think I completely understand how Pay Per View works with customization - especially in the Avada theme. In a nutshell, I have created a Revolution Slider for each video that I want to protect, and I included one slider as part of the header for each post on my site. I'm trying to protect some of these sliders from being shown to anyone aside from subscribers. I can't include these video sliders in the regular content area of the site due to formatting issues.

I'm not clear on how Pay Per View checks to see whether a specific post (or part of a post) is protected or not, and which files I need to modify.

For example, I modified my header.php file to the following, since I thought this would only display the slider to subscribers - or if posts are not protected by PPV:

if ( function_exists( 'wpmudev_ppw' ) ) {
wpmudev_ppw( avada_slider( $slider_page_id ) );
}
else {
avada_slider( $slider_page_id );
}

But it seems that the slider is displayed no matter what, even if I have Pay Per View set to "Always Enabled" for a post. It only hides the content in the post content section if I have the Pay Per View "Enabled" setting to "Always Enabled".

For "Method", am I supposed to use the global settings, automatic exceprt or manual selection or "use selection tool"?

So how do I:

1. Indicate that individual posts/sliders should be protected and
2. only display these sliders if a user has paid for a subscription - or for the individual content

Can you please explain what I need to do next?

Jeremy

  • Vinod Dalvi

    Hi Jeremy,

    I hope you are well today and thank you for your question.

    For "Method", am I supposed to use the global settings, automatic exceprt or manual selection or "use selection tool"?

    In this usage, enabled/disabled and method settings of the post has no significance. Such an html code will be fully protected. However, Plugin Accessibility Settings will be applied.

    1. Indicate that individual posts/sliders should be protected and
    2. only display these sliders if a user has paid for a subscription - or for the individual content

    You can try using any of the following code by configuring variable values in it like slider_page_id, price etc.

    <?php
    if ( function_exists( 'wpmudev_ppw_html' ) ) {
    	 $slider_page_id = 1;
    	 ob_start();
    	 avada_slider( $slider_page_id );
    	 $avada_slider = ob_get_contents();
    	 ob_end_clean();
         $html = $avada_slider; // html code to be protected (required)
         $id = 1; // An optional unique id if you are using the function more than once on a single page
         $description = 'video'; // Optional description of the protected content
         $price = '1.50'; // Optional price for a single view. If not set, price set in the post will be applied. If that is not set either, Unit Price in the Global Settings will be used.
         echo wpmudev_ppw_html( $html, $id, $description, $price );
    }
    ?>

    Or

    <?php
     $slider_page_id = 1;
    if ( function_exists( 'wpmudev_ppw' ) )
    	 ob_start();
    	 avada_slider( $slider_page_id );
    	 $avada_slider = ob_get_contents();
    	 ob_end_clean();
         echo wpmudev_ppw( $avada_slider );
    else
         avada_slider( $slider_page_id );
    ?>

    Best Regards,
    Vinod Dalvi

  • Jeremy

    Hi Vinod,

    I implemented the following code (again, in my headers.php):
    if ( function_exists( 'wpmudev_ppw' ) ) {
    ob_start();
    avada_slider( $slider_page_id );
    $avada_slider = ob_get_contents();
    ob_end_clean();
    echo wpmudev_ppw( $avada_slider );
    }
    else {
    avada_slider( $slider_page_id );
    }

    However, if I enable PPV for a specific post, it displays the payment buttons - and description - twice. The first time isn't well formatted, and the second is formatted.

    Is this something easy to fix?
    I'm attaching a screenshot to show what I mean.

    Jeremy

  • Vinod Dalvi

    Hi Jeremy,

    It seems you are also displaying the PPV buttons on the page using Pay Per View settings and using the provided code so it's displaying twice.

    Could you please check the Pay Per View settings for it?

    Also would you mind if I logged in to your site and did some troubleshooting? This might help get to the bottom of this faster. If this is ok, just grant me temporary admin access to your site by clicking "Grant Access" button in the WPMU DEV Dashboard Settings as described on the following page and reply on this thread after granting it?

    https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Regards,
    Vinod Dalvi

  • Jeremy

    Hi Vinod,

    That sounds good. I'll do that in a few minutes.

    Note that I am using the avada-child theme, and all of the code changes are in the headers.php and functions.php files. I commented out the code because it was causing these issues.

    The first page I would like to protect (as an example) is http://terrydimonteshow.com/producers-vault/don-cherry-on-donohues-legends/

    Since the header file gets displayed in EVERY page of my site, I have no choice but to use the PPV settings on the pages where I want to protect content (only about 1/4 of the pages).

    I also notice that when I uncomment out the code, I get issues on other pages of my site.

    Is there a way to set a custom field for the posts where I want to protect the content, and check for that before calling the wpmudev_ppw function?

    Please let me know.

    Jeremy

  • Jeremy

    Hi Kasia,

    Thanks! I'm open to trying that; can you try to make this slider look exactly the same as in my original pages? I just need to make sure it will look right. When I open this page, the slider doesn't expand to fill the screen like it does in my other pages.

    I was really hoping for an elegant solution that would allow me to protect content outside of the content area.

    I will re-activate PPV once I can ensure the content will look right - I will do it on a page by page basis.

    Can you please let me know if you can make this slider look exactly like the original page?

    Thanks again!

    Jeremy

  • Kasia Swiderska

    Hello Jeremy,

    OK, so for making video look like on the Home Page we need to use some custom CSS code. It would be great if you have child theme or you can use https://wordpress.org/plugins/simple-custom-css/ plugin for adding it (if your theme has section Custom CSS it can be used also).

    .width-100 .type-page .fullwidth-box.video-background {margin: -36px -13% 30px;}

    this code will change the video look on the pages. See if it is working. If needs more adjustments, please grant support access again and I will take a look.

    Kind regards,
    Kasia

  • Jeremy

    Hi Kasia,

    Thank you for your help - this is exactly what I was looking for! I do have another issue now, as I don't see the option for Facebook login prior to payment. I added my Facebook app ID, but I don't see any options for logging in on my pages with protected content. Can you please take a look (using the same URL you created above).

    I haven't attempted Google or Twitter integration yet - I would like to get the Facebook login working first. Please let me know if I missed something.

    http://terrydimonteshow.com/interview-with-sugar-sammy/

    Jeremy

  • Jeremy

    Hi Kasia,

    I just granted you support access.

    Actually it seems that the login buttons do show up, but I have to click on "subscribe for 12 months" in order to see them. I would like to make the login buttons larger, appearing more like the demo on your website. I can figure out the css to reformat them, but can you make them display by default?

    Also, I got the Facebook login to work, but Twitter does not seem to work yet. I set up the app, but for some reason it gives me an error when I try to log in. I didn't fill in the callback URL field in the Twitter app, so could that be the issue? What permission access level should I have chosen? I went with the default.

    Also, if someone purchases access to an individual show, I would like to allow them to access that single show for a year as well, with the ability to log in via social media. Is that possible?

    Finally, I would like to remove the sign up by Wordpress option altogether. Do you recommend any third-party apps for user management and signup? Maybe even something by WPMUDev?

    Thanks again for all of your help!

    Sincerely,
    Jeremy

  • Kasia Swiderska

    Hello Jeremy,

    As for the login buttons showing only on click this is by design - it is triggered event in jQuery script, so changing this would require rewriting scripts in the plugin.

    As for the twitter, it looks like there is problem with the token from the app. I was able to replicate this on my site with different settings. I will flag plugin developer to check this issue.

    Finally, I would like to remove the sign up by Wordpress option altogether.

    Do you want to remove this button for WP login or also don't want to use the wp-login.php page to login?

    Kind regards,
    Kasia

  • Jeremy

    Hi Kasia,

    I understand about the jQuery script - but can you provide me with the CSS to duplicate the screenshot on your Pay Per View plugin site? It's the second and 4th image here: https://premium.wpmudev.org/project/pay-per-view/ and I'll attach the image as well.

    Also, I would like to rename the WP login button, and use a different WPMU plugin for both sign up and log in. Can you recommend which plugin to use for that, and help walk me through that?

    Another related question: you had given me the CSS to make my videos display fullscreen in pages, but I need to also have them display full screen in posts. Can you take a look, and let me know what CSS I would need for that?

    Please let me know once you hear back about the Twitter login. It looks like the token field is submitting blank, so I'm not sure if that's an issue with the plugin itself, or an issue with my Twitter app. For the Twitter app, am I supposed to fill in the callback redirect field? And should the "Enable Callback Locking" option be enabled?

    Thank you again for all of your help!

    Jeremy

  • Vinod Dalvi

    Hi Jeremy,

    I understand about the jQuery script - but can you provide me with the CSS to duplicate the screenshot on your Pay Per View plugin site? It's the second and 4th image here: https://premium.wpmudev.org/project/pay-per-view/ and I'll attach the image as well.

    It's the theme stylesheet which is applied on Pay per view buttons so we don't have that CSS to provide you but if you just share us the page URL from your site where you are displaying the Pay per view buttons then we can help you to develop that CSS code.

    Also, I would like to rename the WP login button, and use a different WPMU plugin for both sign up and log in. Can you recommend which plugin to use for that, and help walk me through that?

    I am not sure what you meant by renaming these buttons?

    Do you want to change the text displayed on these buttons or change the URLs which these buttons are pointing or anything else?

    Another related question: you had given me the CSS to make my videos display fullscreen in pages, but I need to also have them display full screen in posts. Can you take a look, and let me know what CSS I would need for that?

    I can see the video is displaying full width on your post http://yoursite.com/producers-vault/donohues-legends/don-cherry-on-donohues-legends/

    Please advise.

    Please let me know once you hear back about the Twitter login. It looks like the token field is submitting blank, so I'm not sure if that's an issue with the plugin itself, or an issue with my Twitter app. For the Twitter app, am I supposed to fill in the callback redirect field? And should the "Enable Callback Locking" option be enabled?

    These options should be set to default.

    We have notified the plugin developer about this and he will reply here ASAP.

    Regards,
    Vinod Dalvi