Support » Fixing WordPress » Admin Question

  • In my side bar the Meta items are shown (Login/Logout – Register – WordPress – XFN – Valid XHTML – Valid CSS) I was just wondering what code I would enter to hide all those items Except Register and Login/Out unless I’m logged in as administrator. I’m currently using:

    <?php if(is_home()) {?>
      <?php get_links_list(); ?>
    			<?php wp_register(); ?>
    			<li><?php wp_loginout(); ?></li>
    			<li><a href="" title="Powered by WordPress, state-of-the-art semantic personal publishing platform.">WordPress</a></li>
    			<li><a href=""><abbr title="XHTML Friends Network">XFN</abbr></a></li>
    			<li><a href="" title="This page validates as XHTML 1.0 Transitional">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a></li>
    			<li><a href="" title="This site emits a Valid CSS">Valid <abbr title="Cascading Style Sheets">CSS</abbr></a></li>
    			<?php wp_meta(); ?>
      <?php }?>
      <?php endif; ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • You will want to delete the 3 or 4 lines after these two lines

    <?php wp_register(); ?>
    <li><?php wp_loginout(); ?></li>

    But just make a copy of the file before you edit it, make your edits, test how your site looks, make more edits to get it the way you want. You always have the original file to fall back to.

    I would like the other links to show up only if I’m logged in as an admin. Is there any way to check and see if admin is logged in? Like is_admin or is_logged_in or something like that?

    This search of the forums produced a number of results including this this thread with this example:

    <?php if ( $user_ID ) : ?>
    User is logged in
    <?php else : ?>
    User is not logged in
    <?php endif; ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Admin Question’ is closed to new replies.