By default, if a restricted post is shown in the Category Archive, the content will be replaced with the Content Restriction message that you configured.
With the custom code from below, we can make the posts show the Excerpt on the Category Archive pages and only when the user clicks on a post to see the whole content, they will see the restriction message.
add_filter( 'pms_content_restriction_message', 'pmsc_cr_show_excerpt_in_category_pages', 20, 3);
function pmsc_cr_show_excerpt_in_category_pages( $message, $message_type, $post_id) {
if ( !is_archive() || empty($post_id) ) return $message;
$excerpt = get_the_excerpt( $post_id );
if ( !empty($excerpt) )
return $excerpt;
else
return $message;
}
Accept (recurring) payments, create subscription plans and restrict content on your website. Easily setup a WordPress membership site using Paid Member Subscriptions.
Get Paid Member SubscriptionsCombine the power of Profile Builder with Paid Member Subscriptions to set up user registration, memberships, and recurring revenue.
Get 25% off with the bundle