-1

ログインしていないユーザーに表示したい html のブロックを表示するために、header.php の wordpress テーマでこれを使用しています。

<?php
if ( ! is_user_logged_in() && ! ( is_page( '/register' ) || is_page( '/login' ) ) ) {
echo '';
} else {
echo '<div class="container" style="text-align:center;">
       <div class="well" style="width:1040px;margin:0    auto;background:#fbfbfb;margin-bottom:10px;">
  <h3>Welcome, visitor!</h3>
  <p style="color:#999;">Welcome to autospot.it the automotive social network! <a href="http://autospot.it/about">Learn more...</p>
  <p><a href="http://www.autospot.it/register/" class="btn btn-primary btn-large">Register</a> - or - <a href="http://www.autospot.it/login/" class="btn btn-danger btn-large">Login</a> 
  </div>
      </div>';
} 
?>

これは問題なく動作しますが、ログイン ページと登録ページにも表示されないようにしたいと考えています。

4

1 に答える 1