<?php wp_loginout('/'); ?>
Thread Starter
leahs2
(@leahs2)
Where do I put this code?
Thank you!
that depends on where you want the logout to show:
for instance, you could put it quite visible at the top of the sidebar:
edit sidebar.php of TwentyTen; find:
<div id="primary" class="widget-area" role="complementary">
<ul class="xoxo">
change it to:
<div id="primary" class="widget-area" role="complementary">
<?php if ( is_user_logged_in() ) { ?><ul class="xoxo"><li id="logout" class="widget-container">
<h3 class="widget-title"><a href="<?php echo wp_logout_url( get_bloginfo('url') ); ?>" title="Logout">Logout</a></h3></li></ul><?php } ?>
<ul class="xoxo">
http://codex.wordpress.org/Function_Reference/wp_logout_url
—
or into the bottom line in the footer:
edit footer.php; find:
</div><!-- #site-info -->
<div id="site-generator">
change it to:
</div><!-- #site-info -->
<?php if ( is_user_logged_in() ) { ?><div class="logout" style="float:left;"><a href="<?php echo wp_logout_url( get_bloginfo('url') ); ?>" title="Logout">Logout</a></div><?php } ?>
<div id="site-generator">
Thread Starter
leahs2
(@leahs2)
Hey alchymyth, thanks so much for the detailed reply! I will be doing this shortly…