Include a file

<?php include_once($_SERVER[“DOCUMENT_ROOT”] . base_path() . path_to_theme() . “/nav.php”); ?>

Condition for Login Logout

<?php if (user_is_logged_in()): ?>  <p>Hello, logged in user</p>

<?php else:?>  <p>Hello, stranger</p>

<?php endif;?>

Conditional Tags Test

<?php
$conditions = array(
  'is_home()',
  'is_front_page()',
  '$wp_query->is_posts_page',
  'is_page()',	
  'is_single()',
  'is_singular()',
  'is_attachment()',
  'is_search()',
  'is_archive()',
  'is_category()',	
  'is_tag()',
  'is_tax()',	
  'is_author()',	
  'is_day()',
  'is_month()',
  'is_year()',
  'is_time()',
  'is_date()',	
  'is_paged()',
  'is_comments_popup()',
  'is_preview()',
  'is_404()',	
);

echo '<h2>Conditional Tag</h2><ul>';
  $i = 0;
  foreach ( $conditions as $condition ) :
    $condition = str_replace('()', '', $conditions[$i]);

    switch ( $condition ) :
      case 'is_front_page' :
        $query = is_front_page();
        break;
      case '$wp_query->is_posts_page' :
        $query = $wp_query->is_posts_page;
        break;
      default :
        $query = $wp_query->$condition;
        break;
    endswitch;

    echo '<li><code>' . $conditions[$i] . '</code>';
    echo $query ? ': <span style="color:green">true</span>' : ': <span style="color:red">false</span>'; 
    echo '</li>';

    $i++;
   endforeach;
echo '</ul>';
?>