title: Wordpress 'If' Statement
body: <p>I have made a custom author.php page in my wordpress theme that successfully pulls in all the member's details from the DB.</p>
  
  <p>I want to add an if statement before the details are brought it that only shows the info if a <code>_mgm_user_status = expired</code>. <code>_mgm_user_status</code> is in the db as <code>wp_usermeta</code>. These details are all in the db, I just can't work out how to add the if statement before hand. </p>
  
  <p>If the users status is not 'expired' all the info should pull in as usual. If it is 'expired' then a warning should be presented like '<code>&lt;p&gt;Sorry, user not found&lt;/p&gt;</code>'.</p>
  
  <p>Thanks for your help with this guys.</p>
  
  <p>Like so??</p>
  
  <pre><code>&lt;?php
                                                  $user_id = get_current_user_id();
                                                  if ($user_id == 0) {
                                                      echo 'You are currently not logged in.';
                                                  } else {
                                                      echo 'You are logged in as user '.$user_id;
                                                  }
                                                  ?&gt;&lt;?php
                                                      $userID = intval($author);
                                              if(isset($_GET['author_name'])) :
                                              $curauth = get_userdatabylogin($author_name);
                                              else :
                                              $curauth = get_userdata(intval($author));
                                              endif;
                                              ?&gt;&lt;?php $is_expired = get_user_meta($user_id,     '_mgm_user_status', true);
                                                  if(!empty($is_expired) &amp;&amp; $is_expired ==     'expired') {
                                                      echo 'Sorry, user not found';
                                                  }
  ?&gt;
  
  &lt;ul class="profile-list"&gt;
      &lt;li&gt;
      &lt;?php echo get_avatar($curauth-&gt;ID, 95, get_bloginfo('template_url').''); ?&gt;&lt;/li&gt;
  
      &lt;li&gt;&lt;strong&gt;Member No.:&lt;/strong&gt;
      &lt;?php echo $curauth-&gt;_mgm_cf_membership_id; ?&gt;&lt;/li&gt;
  
      &lt;li&gt;&lt;strong&gt;Title:&lt;/strong&gt; &lt;?php echo $curauth-&gt;_mgm_cf_title; ?&gt;&lt;/li&gt;
  
      &lt;li&gt;&lt;strong&gt;First Name:&lt;/strong&gt;
      &lt;?php echo $curauth-&gt;first_name; ?&gt;&lt;/li&gt;
  
      &lt;li&gt;&lt;strong&gt;Surname:&lt;/strong&gt; &lt;?php echo $curauth-&gt;last_name; ?&gt;&lt;/li&gt;
  
      &lt;li&gt;&lt;strong&gt;Job Title:&lt;/strong&gt;
      &lt;?php echo $curauth-&gt;_mgm_cf_job_title; ?&gt;&lt;/li&gt;
  
      &lt;li&gt;&lt;strong&gt;Email:&lt;/strong&gt; &lt;?php echo $curauth-&gt;_mgm_cf_email; ?&gt;&lt;/li&gt;
  
      &lt;li&gt;&lt;strong&gt;Organisation:&lt;/strong&gt;
      &lt;?php echo $curauth-&gt;_mgm_cf_organisation; ?&gt;&lt;/li&gt;
  
      &lt;li&gt;&lt;strong&gt;Type of Organisation:&lt;/strong&gt;
      &lt;?php echo $curauth-&gt;_mgm_cf_types_of_organisation; ?&gt;&lt;/li&gt;
  
      &lt;li&gt;&lt;strong&gt;Service Provided:&lt;/strong&gt;
      &lt;?php echo $curauth-&gt;_mgm_cf_service; ?&gt;&lt;/li&gt;
  
      &lt;li&gt;&lt;strong&gt;Address:&lt;/strong&gt;
      &lt;?php echo $curauth-&gt;_mgm_cf_address; ?&gt;&lt;/li&gt;
  
      &lt;li&gt;&lt;strong&gt;Town/City:&lt;/strong&gt;
      &lt;?php echo $curauth-&gt;_mgm_cf_city; ?&gt;&lt;/li&gt;
  
      &lt;li&gt;&lt;strong&gt;County:&lt;/strong&gt;
      &lt;?php echo $curauth-&gt;_mgm_cf_state; ?&gt;&lt;/li&gt;
  
      &lt;li&gt;&lt;strong&gt;Postcode:&lt;/strong&gt;
      &lt;?php echo $curauth-&gt;_mgm_cf_zip; ?&gt;&lt;/li&gt;
  
      &lt;li&gt;&lt;strong&gt;Region:&lt;/strong&gt;
      &lt;?php echo $curauth-&gt;_mgm_cf_region; ?&gt;&lt;/li&gt;
  
      &lt;li&gt;&lt;strong&gt;Country:&lt;/strong&gt;
      &lt;?php echo $curauth-&gt;_mgm_cf_country; ?&gt;&lt;/li&gt;
  
      &lt;li&gt;&lt;strong&gt;Telephone:&lt;/strong&gt;
      &lt;?php echo $curauth-&gt;_mgm_cf_phone; ?&gt;&lt;/li&gt;
  
      &lt;li&gt;&lt;strong&gt;Mobile:&lt;/strong&gt;
      &lt;?php echo $curauth-&gt;_mgm_cf_mobile; ?&gt;&lt;/li&gt;
  
      &lt;li&gt;&lt;strong&gt;Fax:&lt;/strong&gt; &lt;?php echo $curauth-&gt;_mgm_cf_fax; ?&gt;&lt;/li&gt;
  
      &lt;li&gt;&lt;strong&gt;Website:&lt;/strong&gt;
      &lt;?php echo $curauth-&gt;_mgm_cf_website_url; ?&gt;&lt;/li&gt;
  
      &lt;li&gt;&lt;strong&gt;Other Info:&lt;/strong&gt;
      &lt;?php echo $curauth-&gt;_mgm_cf_other_info; ?&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>