Forum Replies Created

Viewing 1 replies (of 1 total)
  • Can you please address this issue in the next update? I tried to set up a login page that catches users trying to access my hidden content, instead of the 404 page but I cannot avoid the 404 page no matter what settings I select from the UAM settings panel.

    My eventual solution was to add some code to my 404 page template that checks the page url for the custom post type slug, if true it shows the login form and if false shows the 404 page as it should.

    See below for those with a similar issue:

    <?php
    
    	$url = $_SERVER['REQUEST_URI'];
    
    	if(strpos($url, 'custom-post-type-slug') == true){
    
    		$args = array(
    			'form_id' => 'loginForm',
    			'label_username' => __( 'Username' ),
    			'label_password' => __( 'Password' ),
    			'label_remember' => __( 'Remember Me' ),
    			'label_log_in' => __( 'Log in to view content' ),
    			'remember' => true
    		);
    		wp_login_form( $args );
    
    	} else if (strpos($url, 'custom-post-type-slug') == false) {
    
    	// 404 page content here
    
    	}
    
    ?>
Viewing 1 replies (of 1 total)