WordPress Plugin

Content Wrappers (JS Mode)

Add wrappers to protect your content directly into the your WordPress templates like single.php, Or use the functions.php to add your wrapper. In JavaScript Mode you can have additional control using the JavaScript callbacks here.

Templates

Scenario 1 - Remove all but first paragraph

This wrapper will look for the first paragraph and keep it, then remove the rest of the wrapped content.

<div class="pigeon-first-p">
	<p>The content of your article. Only this paragraph will show if the visitor is not authorized.</p>
	<p>This paragraph and any subsequent content will be removed if the visitor is not authorized.</p>
	<?php get_the_content(); ?>
</div>

Scenario 2 - Remove all content

This wrapper will all the content within the wrapper.

<div class="pigeon-remove">
	<p>All content with a class of pigeon-remove will be removed if the visitor is not authorized.</p>
	<?php get_the_content(); ?>
</div>

Promotional Wrapper

The following wrapper will show when a person does not have access. You can put your promotional copy and calls to action in there.

<div class="pigeon-context-promotion" style="display:none;">
    <?php // You could show the excerpt here if you are removing all content in Scenario 2 ?>
    <?php get_the_excerpt(); ?>
    <?php 
        // This is where you can promote your content.
        // The link with a class of pigeon-open will open the pigeon modal in JS Mode
    ?>
    <p>This page is available to subscribers. <a href="#" class="pigeon-open">Click here to sign in or get access</a>.</p>
</div>

Facebook WebView Wrapper (optional)

The Facebook mobile app opens shared content in their own web viewer. This web viewer limits the ability for the Pigeon plugin to check the status of a user, thus showing your potentially protected content. And sometimes this web viewer doesn't represent your content correctly. So this block will lead the viewer to open the page in the mobile device's native browser app.

<div class="pigeon-facebook-webview" style="display:none;">
    <p>It looks like you are opening this page from the Facebook App. This article needs to be opened in the browser.</p>
    <p><strong>iOS</strong>: Tap the three dots in the top right, then tap on "Open in Safari".</p>
    <p> <strong>Android</strong>: Tap the Settings icon (it looks like three horizontal lines), then tap App Settings, then toggle the "Open links externally" setting to On (it should turn from gray to blue).</p>
</div>

functions.php

This approach allows you to wrap the content at the function level in WordPress.

Example

add_filter( 'the_content', 'pigeon_content_filter', 20 );

/**
 * @uses is_single()
 */
function pigeon_content_filter( $content )
{
	if (is_single()) {
        // Wrap content with secure block and add promotional landing page
		$content = '<div class="pigeon-remove">' . $content . '</div>';

		$content .= '<div class="pigeon-context-promotion" style="display:none;">'
                        . get_the_excerpt()
                        .'<p class="pigeon-cta">'
                            .'This page is available to subscribers. <a href="#" class="pigeon-open">Click here to sign in or get access</a>.'
                        .'</p>'
                    .'</div>';

		$content .= '<div class="pigeon-facebook-webview" style="display:none;">'
		                .'<p>It looks like you are opening this page from the Facebook App. This article needs to be opened in the browser.</p>'
                        .'<p><strong>iOS</strong>: Tap the three dots in the top right, then tap on "Open in Safari".</p>'
                        .'<p> <strong>Android</strong>: Tap the Settings icon (it looks like three horizontal lines), then tap App Settings, then toggle the "Open links externally" setting to On (it should turn from gray to blue).</p>'
                    .'</div>';
	}

	return $content;
}