Hechelbach It is you may have noticed here and there: Not only is the blog title is clickable, but also the description. You can also call this area of ​​subtitles. You have a visitor this is no real additional functionality - you just go from there to home than you would click on the blog title. The blogger, at least when he gets logged, but from there directly into the admin area. Maybe this gimmick is interesting for you - to get to the dashboard, you must not then shimmy to the Admin link, as the blog description is indeed the top of the page header and is thus always within easy reach. We were here a long time, until soft, blog title and description of the new design had, for the display of which we have abolished the title and description.

The good thing is that this can be achieved with very little code. The place where this is happening, the header.php. Just search <?php bloginfo('name'); ?> and <?php bloginfo('description');?> . The section that looks mostly like this:

<!-- No.1: USUAL WAY. CLICK ON BLOG TITLE LETS YOU RETURN HOME WHILE THE DESCRIPTION IS JUST A DESCRIPTION NOT A CLICKABLE AREA. -->
<div id="header">
<div id="headerimg">
<h1><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
<div class="description"><?php bloginfo('description'); ?></div>
</div>
</div>
<!-- END of No.1 -->

just replace this by:

<!-- No.2: THE FOLLOWING COMMENTED PART IMPLEMENTS DIRECT ACCESS TO ADMININSTRATION BY CLICKING ON THE BLOG DESCRIPTION WHILE ANYONE WHO IS NOT LOGGED IN RETURNS BACK HOME -->
<div id="header">
<div id="headerimg">
<h1><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
<div class="description">
<a href="<?php
if (current_user_can('level_10'))
echo get_settings('home').'/wp-admin/">';
else
echo get_settings('home').'/">';
bloginfo('description'); ?>
</a>
</div>
</div>
</div>
<!-- END of No.2 -->

What is the code? While clickable in Option 1, the standard header, blog title and description are displayed in the header, but only the title and the user back to home brings ( <a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a>) , is in version 2, which also shows both polled by clicking on the description of the user's permission. current_user_can('level_10') is the highest authority, namely the administrators. That sits just in front of the computer is logged in, look to your own blog and would like to urgently go to the dashboard, so all he needs (or her, of course) clicking on the description for this blog. Users who are not registered and therefore does not have appropriate permissions, instead simply beamed to home.

Theoretically (and practically) the authorization request for other functions makes sense that only the administrator should be available. The range of privileges ranging from 0 (the registered user) through 1 (the employees), 2 (the blog author) and 7 (the publisher) to give 10 (the administrator). Of course, the permission bits are backward compatible: An admin can do everything (levels 10 to 0), because the publisher is already impaired (Level 7-0), etc.

Bookmark and Share

Comments are not possible.

My Flickr

By Erik Rasmussen
Made on a Gammelrechner Made on an Eee
Werbefreier Blog
Translator
German flagItalian flagPortuguese flagEnglish flagFrench flagSpanish flagDutch flagDanish flagFinnish flag
Polish flagSwedish flagNorwegian flagGalician flag     
By N2H