normal page login view

Home Forums Legacy Support Support queries How-to & Troubleshooting normal page login view

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #170889
    endifelse
    Participant
    i maked normal page in category - knowlege. i want this page view login user. however, now all user view in this page. What should I do?
    site : k-desi9n.kr/edu submaster / alpha1234      
    #170900
    Diana
    Participant
    @endifelse I am sorry, I didn't understand your issue. Can you please rephrase it
    #170909
    endifelse
    Participant
    here is image, post document, this post is view in login user, but i dont know that   please help    
    #171016
    Diana
    Participant
    @endifelse, Please paste the below code in wp-admin > Plugins > Editor > Select WPLMS Customizer Plugin > wplms-customizer.php In the below code i have written 6. Instead of that you have to put there your page id. Hover on the edit page link and you'll get the page id refer: http://prntscr.com/kd8unl add_action( 'template_redirect', 'protect_goal_page' ); function protect_goal_page() { global $post; if( $post->ID == 6 ){ if( ! is_user_logged_in() ){ wp_redirect( home_url()); } } }  
    #171530
    endifelse
    Participant
    Thank you for teaching me. But instead of adding an id each time you write, is there any way you can aplly all the text at once?   In addition, an error message is displayed when an alert window is placed here. if( ! is_user_logged_in() ){   alert("please login!") <<-- error wp_redirect( home_url());   }
    #171611
    Diana
    Participant
    @endifelse In your above post you have showed me that knowledge page so i thought you want to limit the access for only that particular page. Please tell me do you want it for each and every page and post? So that non-logged in users cannot access that page
    #172231
    endifelse
    Participant
    Limited to knowledge pages. There are several pages in the knowledge page, It is inconvenient to write an id every time you write. So I ask you how you can solve it at once.
    #172258
    Diana
    Participant
    @endifelse, If these pages are under Knowledge page and when you paste the above code. A non-logged in user cannot access the Knowledge page so it is not possible to access the pages inside the knowledge page for a non-logged-in user
    #172321
    endifelse
    Participant
    Thank you for teaching me.
    #172338
    Diana
    Participant
    @endifelse Thanks for confirming. Closing the topic
Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘normal page login view’ is closed to new replies.