Sign-Up Prompt Near the End of Posts
Invites logged-out readers to create a free account three quarters of the way through each article, when they are most engaged.
Opens WPIDE on
Code
<?php if ( ! is_user_logged_in() && get_option( 'users_can_register' ) ) : ?>
<aside class="wpide-signup-prompt" style="margin:2em 0;padding:1.25em;border-radius:8px;background:rgba(127,127,127,.08);text-align:center">
<p style="margin:0 0 .75em"><strong>Enjoying this article?</strong> Create a free account to get new posts and join the discussion.</p>
<a class="wp-element-button" href="<?php echo esc_url( wp_registration_url() ); ?>">Create my account</a>
</aside>
<?php endif; ?>
Notes
Only shows when "Anyone can register" is enabled in Settings > General.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.