0

how to set without user loging inner pages is disable or display message please loging Frist

Ex. I want if user not loging and open abouts us page and display message please loging Frist and don't see any countain. When user login click on about us page see all countain

  • Your question is not clear and as per the assumption you need to check the content of a page depending upon the user logging. You can do so by using is_user_logged_in and if this not what you are looking for, then please add a substantial amount of information regarding the same – Maruti Mohanty Dec 18 '13 at 11:01
  • Ex. I want if user not loging and open abouts us page and display message please loging Frist and don't see any countain. When user login click on about us page see all countain – krunal sojitra Dec 18 '13 at 11:11
  • This is something you can find easily by making a search in the codex or in the community here. Please do it – Maruti Mohanty Dec 18 '13 at 11:13
0

You can use the function

    <?php if ( is_user_logged_in() ) {
    //load your page here
    } else{
      echo ("Please <a href=".wp_login_url().">Login</a> First");
    }?>
| improve this answer | |
  • your ans is right but i have tomany template when i use this code add in all pages. if any solution like i add some code in my project – krunal sojitra Dec 18 '13 at 11:22
  • You can use that code in your header.php file. It will automatically load in your every pages. – Yamu Dec 18 '13 at 11:27
  • I got the Answer its easy by css.. main div(.lor1) means comman div start after header and finesh before footer Add new class (.lor1.kun) in main div when user loging this main class display: block; make new html Ex. display mess loging frist one (.lor1.user_not_login) ` <?php if (!is_user_logged_in()) { ?> <style> .lor1{ display:none;} .lor1.kun{ display: block;} .lor1.user_not_login{ display: block;} </style> <?php } ?> ` – krunal sojitra Dec 19 '13 at 8:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.