Resources

My Agape try

Your Agape try


Support Forum

You must be logged in to post Login Register

Search 
Search Forums:


 




Login form

UserPost

8:09 pm
February 13, 2011


daveku

New Member

posts 1

1

First of all, thanks for a fantastic plugin. I'd say your efforts at agape are going well. ;)

I have what I hope is an easy question, but I haven't been able to find an answer in the docs or this forum. How do I display a login form if a protected page is accessed by a restricted user? I get a 404 if I access one of these pages without logging in first.

1:04 pm
March 3, 2011


Kevin

Admin

posts 2503

2

That feature is not built in, but you can modify the appropriate template file (single.php, page.php, etc.) to selectively call wp_login_form(). Here's how:

If you are using the Hidden Content Teaser:

if ( is_teaser_rs() ) {
  $login_args = array(); // see WP doc for available parameters
  wp_login_form( $login_args );
}

If you are not using the Hidden Content Teaser, there is currently no property or template function to distinguish between an actual "not found" status and an RS-imposed 404. But you can do that with something like this in 404.php:

global $wp_query;
$args = $wp_query->query_vars;
$args['suppress_filters'] = true;

if ( $post_check = query_posts( $args ) ) {
   $login_args = array(); // see WP doc for available parameters
   wp_login_form( $login_args );
}

About the Agapetry forum

Currently Online:

13 Guests

Maximum Online: 150

Forums:

Groups: 2

Forums: 7

Topics: 1247

Posts: 5656

Members:

There are 1259 members

There are 1 guests


Kevin has made 2503 posts

Top Posters:

metal450 - 178

Ragnar - 108

YikYak - 70

whiteorb - 49

Daisy - 35

Administrator: Kevin | Moderators: Kevin