• Home
  • New Entries
  • Popular Entries
  • Submit a Story
  • About

A Better Spot for The WordPress Meta ...

One of the first things many new blog owners do is remove the Meta section from their sidebars. Great idea. The Meta information is almost completely useless. And I’m not the only one that thinks so.

View More Info

One of the first things many new blog owners do is remove the Meta section from their sidebars. Great idea. The Meta information is almost completely useless. And I’m not the only one that thinks so.

    The Meta section includes some admin links like “Login” or “XHTML Valid.” While those links might be useful for the owner of the blog, they offer no value at all for the reader. The next time you set a Wordpress blog up, start by removing the Meta section from the sidebar. Daily Blog Tips

But you know what? It’s only almost completely useless. It has two great functions; it gives you a link to your admin area from every page and it lets you logout from your blog. Pretty handy when you’re on a public computer. How can we fix this up so we don’t look amateurish and still retain the useful functionality? Easy! Conditional tags and Javascript.

Well, kinda easy. If you want to implement this on your blog you’ll have to do some fiddling around with your theme. No guarantees that the following technique won’t make your site explode.

Here’s what we want to do. Only show the login block to logged-in users and while we’re at it take the whole thing out of the sidebar and put it somewhere really useful: in a sliding panel that drops down from the top of the page with a click, wherever you are on the page.

First a little XHTML and some WordPress template tags. You’ll probably want to add this above your header (it really depends on your theme).

<?php if (is_user_logged_in()) { ?>
<div id="site-meta">
<div id="meta-panel">
<ul>
<?php wp_register() ?>
<li><?php wp_loginout() ?></li>
</ul>
</div>
<a href="" id="meta-anchor">Site Meta</a>
</div>
<?php } ?>

What this bit of code does is setup a little list of two links only available to logged-in visitors; a link to the site admin (<?php wp_register() ?>) and a logout link (<li><?php wp_loginout() ?></li>). All wrapped up in some horribly un-semantic divs with a link to nowhere (<a href="" id="meta-anchor">Site Meta</a>). Perfect.

Here’s what you should be looking at if you’re logged-in to your blog.


Not very exciting is it? What we need now is some CSS and Javascript, jQuery to be precise. Add the following to your themes functions.php file if it’s not already there. This will make the jQuery Javascript framework that ships with WordPress available to your theme.

// load jQuery
 wp_enqueue_script(jquery);

I’d put it somewhere near the bottom or top (but not on the first or last line). Now for some CSS.

#site-meta {
position:fixed;
width:100%;
z-index:1000;
}
#site-meta li {
display:inline;
}
#meta-panel {
background: #EEE;
}
#meta-panel ul {
width:960px;
margin:0 auto;
padding:36px 0;
text-align:center;
}
#meta-anchor {
display:block;
margin:0 auto;
background:#EEE;
width:50px;
text-indent:-999em;
outline:0;
 }

And a jQuery function (). Add this to your head section after <?php wp_head() ?>. My thanks to Web Designer Wall’s, jQuery Tutorials for Designers for giving me a leg up on the jQuery.

<script type="text/javascript">
jQuery(document).ready(function(){
// Hide the site-meta panel
 jQuery(#meta-panel).hide();

// Toggle site-meta panel visibilty and class when handle is clicked
jQuery(#meta-anchor).click(function() {
jQuery(#meta-panel).slideToggle(50);
jQuery(this).toggleClass("active");
return false;
} );
});
 </script>

And here’s a quick animation showing what we get. It’s no goat eating leaves, but it gets the job done.

source: themeshaper

 View Full Story.
Posted at 02:51:15 pm | Permalink | Posted in Blogging Tips  How to Blog  

Related Stuff

New WordPress feature, Possibly Related Posts

If you have a blog on WordPress.com, you may have noticed a new feature called Possibly Related that links posts from other blogs in the ...

What Do You Need to Set up a Wordpress Blog

I've found myself answering this question a lot lately, so I figure I should just turn it into a blog post so I can point people to ...

How To Make a WordPress Privacy Policy

Ever since Adsense updated their terms and conditions, requiring publishers to display a privacy policy on their website(s), webmasters and ...

WordPress Single Post Templates

Austin recommends using a filter in your functions.php file as an alternative to the method below. IMO, his suggestion is much simpler and ...

Wordpress Plugin - SuperFast Digg This

SuperFast Digg This is really a super fast social bookmarking plugin, it loads faster than others, scalable and with better performance. It ...

Be the first ... |Add your comment.

Your Comment ...

  Name (required)

  Email (required, hidden)

  Website


About Webloglines

Webloglines is a project offers a comprehensive collection of blogging services, articles, themes and plugins from around the world. Whether you're looking to promote your own blog or find blogs on various topics, this site is for you.


Recent Stuff

New WordPress feature, Possibly Related Posts

What Do You Need to Set up a Wordpress Blog

How To Make a WordPress Privacy Policy

WordPress Single Post Templates

Wordpress Plugin - SuperFast Digg This

Fast-Static-Feed WordPress Plugin


Our Partners

Ajax Projects

Web 2.0 Sites

Webloglines

Human Development Handbook

Software Development Company

Ajaxlines


Search


Topics

  • Blogging Tips (40)
  • Blogs Slides (25)
  • Blogs Websites (22)
  • How to Blog (22)
  • Search Engines (1)
  • WordPress Plugins (14)
  • WordPress Security (4)
  • Wordpress Themes (11)
  • Wordpress Tips (9)

© 2006 www.webloglines.com. All Rights Reserved. Powered by IRange