How do I check if the user is watching the front page or the user is logged in?
I think you will want the following:

&lt;?php if ($logged_in || $is_front_page): ?&gt;
    Do something
&lt;?php endif;?&gt;