is_user_logged_in冲突(Wordpress)

I searched for a solution, but I dont finde something suitable. I use the following script part to login/logout at my wordpress website:

<?php if (is_user_logged_in()) { ?>
  <a href="<?php echo wp_logout_url($_SERVER['REQUEST_URI']); ?>"><span>Logout</span></a>   <-- works -->
<?php } else { get_template_part('ajax', 'auth'); ?>                
  <a id="show_login" href=""><span>Login</span></a>
<?php } ?>

If I modify the first part (wp_logout_url) into html it will not work:

<?php if (is_user_logged_in()) { ?>
  <a id="show_profile" href=""><span>Profile </span></a>     <-- dont work -->
<?php } else { get_template_part('ajax', 'auth'); ?>                
  <a id="show_login" href=""><span>Login </span></a>
<?php } ?>

Why html works only at the login part? I´ve done a php error?

There is no link inside the "href", because its fireing the lightbox.

UPDATE: I found out, that the problem will be the "get_template_part", this is requiered to load the content inside the lightbox .. but I dont know how to integrate it in the first part correctly.