Support » Plugin: WP-Members: Membership Framework » [Plugin: WP-Members] Custom Post Type excerpts give "This content is restricted" text

  • Hi first off many thanks to Chad for making such an amazing plugin!

    I seem to be having a problem with custom post types. I have my main “posts” page for my custom post type is set to display excerpts, but instead of an excerpt from my actual post I get the following message:

    This content is restricted to site members. If you are an existing user, please login. New users may register below. Existing Users Login Username Password Remember me New Users RegistrationChoose a Username* First Name* Last Name* Address 1* Address 2 City* State* Zip* Country* Day Phone* Email* *Required field Powered […]

    I have tried simplifying my loop for the custom post type page down to the following (which I borrowed from, but I still get the same “content is restricted” message:

    $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 10 );
    $loop = new WP_Query( $args );
    while ( $loop->have_posts() ) : $loop->the_post();
    echo ‘<div class=”entry-content”>’;
    echo ‘</div>’;

    FWIW, the main blog page of my site is also set to display excerpts and works just fine.

    Here are what my plugin settings currently look like, though the issue seems to be happening whether or not the “Show excerpts” option is checked or not:

    I am using the “Intent” theme from which may be causing some kind of conflict, but I can’t pin it down at this moment.

    If anyone can shed some light on this issue it would be greatly appreciated.


    UPDATE: If I manually unblock a post from my CPT withe the “unblock” custom field, then the excerpt works.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Chad Butler


    Depending on how the custom post type is structured, the plugin may not be able to be used in that situation without some modification.

    The main part of the plugin protects content by taking the WordPress $content variable that is returned from the_content and replaces it with the login/registration form if the user is not logged in.

    Without knowing more about the theme’s custom post type and use of the excerpt, it appears that it is making the excerpt after the_content has been filtered by WP-Members, so it’s making an excerpt of the post restricted message and the form.

    You might be able to overcome this by changing the way this particular custom post type grabs the excerpt when is_user_logged_in is false.

    Thanks Chad for the detailed response! I had a feeling the issue was something along the lines of what you mentioned, but it definitely helps to have some confirmation.

    For the time being I’ve restructured the navigation of the site to include a landing page for members to log into before they are given a link to the CPT blog page. That makes this issue much less important, since I anticipate over 90% of the users won’t see the CPT blog page until they’re already logged in.

    I will do some research on how the theme grabs the CPT excerpts and see what I can figure out.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: WP-Members] Custom Post Type excerpts give "This content is restricted" text’ is closed to new replies.