Title: Premium Content
Last modified: August 19, 2016

---

# Premium Content

 *  Resolved [Eric Mann](https://wordpress.org/support/users/ericmann/)
 * (@ericmann)
 * [18 years ago](https://wordpress.org/support/topic/premium-content/)
 * I have a very specific feature I’d like to add to one of my blogs and I’m hoping
   there is either an existing plugin or someone out there who can help with the
   code.
 * I’d like new posts (less than one month old) to be fully available on the blog
   to all users (registered and unregistered). However, I would like to restrict
   the blog so that, after a post is a month old, only the excerpt is available 
   to ‘free’ users. I would like ‘premium’ users to still have access to the full
   post, though. How can I do this?

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [kenyadenola](https://wordpress.org/support/users/kenyadenola/)
 * (@kenyadenola)
 * [18 years ago](https://wordpress.org/support/topic/premium-content/#post-745616)
 * This describes exactly what my situation is right now. The only difference is
   we want to do the reverse. If you find a solution, I would definitely be interested
   in knowing.
 *  [ollerwe](https://wordpress.org/support/users/ollerwe/)
 * (@ollerwe)
 * [18 years ago](https://wordpress.org/support/topic/premium-content/#post-745652)
 * I am also very interested. Let us see if someone has a solution for this one.
 *  [razorguy](https://wordpress.org/support/users/razorguy/)
 * (@razorguy)
 * [18 years ago](https://wordpress.org/support/topic/premium-content/#post-745665)
 * am also interested in this, but for me, i need something to only hide some portions
   of an article from non-registered guests and ask them to register.
 * for the previous requests, i found this: [http://butlerblog.com/wp-members/](http://butlerblog.com/wp-members/)
 * am sure it will work for you, especially kenyadenola. let me knw if am right
 *  Thread Starter [Eric Mann](https://wordpress.org/support/users/ericmann/)
 * (@ericmann)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/premium-content/#post-745704)
 * I ended up having to write my own script, actually. On the main site page (index.
   php) I just swapped out the part of the loop referring to “the_content” with “
   the_excerpt”:
 *     ```
       <div class="post-content">
            <?php the_content(); ?>
       </div>
       ```
   
 * Becomes
 *     ```
       <div class="post-content">
            <?php the_excerpt(); ?>
       </div>
       ```
   
 * Then I changed the post page (single.php) so that, for the first 30 days a post
   is up, everyone can see it. After 30 days, you need to be registered and logged
   in (authenticated) to see anything but the excerpt:
 *     ```
       <div class="post-content">
             <?php the_content(); ?>
       </div>
       ```
   
 * Becomes:
 *     ```
       <div class="post-content">
       <?php global $user_ID;
             get_currentuserinfo();
       ?>
       <?php $today=date(z); ?>
       <?php $postday=the_date('z', '', '', FALSE); ?>
       <?php if($today - 30 > $postday && $user_ID == '') {
             echo '<p style="font-size: 36px;"><center><a href="<?php bloginfo('url'); ?>/wp-login.php?action=register">Please Register!</a></center></p>';
             echo '<p style="font-size: 11px; font-family: Arial, Helvetica, sans-serif;">You must be a registered user to view this post.  Until you complete your registration, you will only be able to view an excerpt:</p>';
             the_excerpt();
       }
             else {
             the_content();
       }
       ?>
       <!--<?php the_content(); ?>-->
       </div>
       ```
   
 * I hope that helps!
 *  [flick](https://wordpress.org/support/users/mosey/)
 * (@mosey)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/premium-content/#post-745705)
 * Interesting solution, thanks ericmann 🙂
 * p/s: Just wondering if this could ever be extended for Feeds?
 *  Thread Starter [Eric Mann](https://wordpress.org/support/users/ericmann/)
 * (@ericmann)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/premium-content/#post-745730)
 * I’ve decided to take this one step further. Hacking the WP source is fine if 
   you want to do it every time you upgrade … but I’m a bit lazy. So instead I built
   a plugin that does this all for me!
 * What you do is install the plugin, build a new page ([http://blog.com/premium](http://blog.com/premium))
   or something along those lines, and place the shortcode ‘[reglevel]’ on the new
   page. When prospective users go to the new page, they are redirected to the registration
   screen and WP changes the user level to whatever you have set up in the Options»
   RegLevels settings.
 * You can download the plugin here: [http://www.jumping-duck.com/wordpress/](http://www.jumping-duck.com/wordpress/).
   I’m still working to get it hosted on the WP site.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Premium Content’ is closed to new replies.

 * 6 replies
 * 5 participants
 * Last reply from: [Eric Mann](https://wordpress.org/support/users/ericmann/)
 * Last activity: [17 years, 7 months ago](https://wordpress.org/support/topic/premium-content/#post-745730)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
