Membership - WSJ Style

I'm using membership on our newspaper website that's about to offer paid access to content in a similar way that the Wall Street Journal does. Some content will be free and some will paid via the more tag.

Thanks to some awesome work by Mohanjith I got the 2checkout gateway working well.

There's three more features that I'm hoping I can get some help with.

1. On the home page, I'd like to indicate which stories are paid and which are free. WSJ uses a key icon next to the paid stories.

Is there way to do a check for whether the more tag exists in a post and if it does, display an icon.

2. We have about 60,000 posts and have never used the More Tag before. Is there a way to set the more tag on posts that are already published. Since some whole categories will be free, setting the more tag will need to selective. eg.. Only News category should have more tag,Opinion category should not.

3. On the article pages for paid stories I know can set what appears to non-subscribers AFTER the more tag. But how can I set a message that appears above the Article Title to non-subscribers indicating that this is a paid only article and they must sign-up or sign-in.

  • James Farmer
    • CEO (of WPMU DEV, honest)

    Hi Klark,

    1. On the home page, I'd like to indicate which stories are paid and which are free. WSJ uses a key icon next to the paid stories.

    Is there way to do a check for whether the more tag exists in a post and if it does, display an icon.

    That'd be very nice, might have to be a custom thing though.

    2. We have about 60,000 posts and have never used the More Tag before. Is there a way to set the more tag on posts that are already published. Since some whole categories will be free, setting the more tag will need to selective. eg.. Only News category should have more tag,Opinion category should not.

    I think you'll need to run a pretty serious dbase query to update the posts, or you could do it via plugin possibly, here are some leads:

    http://wordpress.org/extend/plugins/search-and-replace/
    http://wordpress.org/support/topic/change-custom-field-value-for-all-posts-using-phpmyadmin
    http://www.lancelhoff.com/wordpress-replace-url-or-text-in-all-posts/
    http://wptricks.net/replace-content-on-your-wordpress-using-sql/

    Could you let us know how you go?

    3. On the article pages for paid stories I know can set what appears to non-subscribers AFTER the more tag. But how can I set a message that appears above the Article Title to non-subscribers indicating that this is a paid only article and they must sign-up or sign-in.

    That'd be good, I certainly hope you can or that we can add that in to the next release, Barry or Mohanjith would have more of an idea about this than myself tho...

    Cheers, James

  • Klark
    • Site Builder, Child of Zeus

    my solution for number 1 & 3 in case anyone needs this in future

    Add this to your functions.php

    function has_more()
    {
    	global $post;
    	if ( empty( $post ) ) return;
    	return (bool) preg_match( '/<!--more(.*?)?-->/', $post->post_content );
    }

    Add this to your single.php where you want it shown.
    for your home page, you'll need to nice it up with a css image and change it a bit.

    <?php if (is_user_logged_in()) : ?>
      <!-- put html you want to show to subscribers if not leave empty-->
    <?php  else: // if user_logged_in ?>
    <?php if (has_more()){ ?>
          <!-- put what you want to show to non-subscribers here-->
    
    <?php } ?>
    <?php endif; ?>

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.