Code Snippet
Admin Panel Link Only For Admins
<?php if (current_user_can("manage_options")) : ?>
<a href="<?php echo bloginfo("siteurl") ?>/wp-admin/">Admin</a>
<?php endif; ?>
If a user is logged in and they are an Admin of the site (not just an subscriber or author), then display a link to get them to the WordPress Admin area. Otherwise, display nothing.
More specific than the regular log in / log out function, which will show for everyone:
<?php wp_loginout(); ?>
really handy piece of code.
thanks Chris.
I think the following (within the loop) does the same thing and lets you go directly to the post or page you want to edit:
<?php edit_post_link(‘Edit’, ”, ”); ?>
Really handy! So, why not combine both scripts and have “Login” and “Edit” for Admins only?
For example, inside the loop:
Really a handy code but some more descriptions would have really made me appreciate you more
DigWP
A book and blog co-authored by Jeff Starr and myself about the World's most popular publishing platform.
Quotes on Design
Design, like Art, can be an elusive word to define and an awfully fun thing to have opinions about.
HTML-Ipsum
One-click copy to clipboard access to Lorem Ipsum text that comes wrapped in a variety of HTML.
Bookshelf
Hey Chris, what books do you recommend? These, young fertile mind, these.