Without user loging inner page is disable wordpress Without user loging inner page is disable wordpress wordpress wordpress

Without user loging inner page is disable wordpress


 <?php     if (!is_user_logged_in()) {?> <style>.lor1{ display:none;}.lor1.kun{ display: block;}.lor1.user_not_login{ display: block;}</style><?php

} ?>

I got the Answer its easy by css..

  1. main div(.lor1) means comman div start after header and finesh before footer
  2. Add new class (.lor1.kun) in main div when user loging this main class display: block;
  3. make new html Ex. display mess loging frist one (.lor1.user_not_login)

ADD this code in header.php


You can check if the user is logged in and filter the content accordingly:

add_filter( 'the_content', 'so20656342_restrict_content', 999, 1 );function so20656342_restrict_content( $content ){    if( ! is_user_logged_in() )        $content = 'Please log in to access this content';    return $content;}