If you ever visit our actual website, you’ve probably noticed the “Print This” button that we display below each post.  Depending on the type of website or blog you are running, having a button like this may be a good fit for your blog.  I’ve found it to be good to have this button available to readers for any type of website that offers tutorials, recipes, guides, or pretty much anything that might require a visitor to print something you’ve written.

If you think you’d like to offer your readers the option to print something on your blog, here is the code I use on my blogs (uses Javascript):

<a href="javascript:window.print()" rel="nofollow">Print This!</a></span>

It prints the page you are on, so it is probably best to use it mostly on post and pages.  If you place it on the blog’s homepage, it will print the entire homepage, not just that post. 

Digg This! | Stumble it! | Add to Del.icio.us | | Print This! |

Do you find you switch WordPress themes a lot?  If you do, Chris Pearson has taken the time to write a great post about using WordPress functions to ease the transition between themes.   The idea is to put all your design elements in one file and then move the file over to your new theme every time you switch, saving you the time of re-coding the specific elements you like to see in your blog’s theme.  

In his post, Chris provides the functions file to get you started, teaches you how to write your own functions, and then explains how to activate and use your new functions. 

I personally have used a functions file on some of my themes, but for me it hasn’t really saved much time.  That is probably because I’ve always prefered to hack my existing theme when I want to see changes, rather than to switch to a completely new theme.   For people that switch themes a lot, a user functions file is definitely something you should consider doing.

Digg This! | Stumble it! | Add to Del.icio.us | | Print This! |

This guest post was written by Jean-Baptiste Jung, who maintains a blog (written in French) that covers WordPress. If you have webmaster or WordPress knowledge and are interested in writing a post for Hack WordPress, please contact us.

Tired of your old navigation? So, what about creating a Magazine-style drop-down menu?
I propose here a drop-down menu listing your pages and sub pages, including one last item to show up your categories directly in the menu.

HTML and PHP

We will start by using WordPress core functions in order to retrieve our pages and categories. Edit the header.php of your theme, and replace your old nav code by this one:

<ul id="nav" class="clearfloat">
<li><a href="<?php echo get_option('home'); ?>/" class="on">Home</a></li>
<?php wp_list_pages('title_li='); ?>
<li class="cat-item"><a href="#">Categories</a>
<ul class="children">
<?php wp_list_categories('orderby=name&title_li=');
$this_category = get_category($cat);
if (get_category_children($this_category->cat_ID) != "") {
echo "<ul>";
wp_list_categories('orderby=id&show_count=0&title_li=
&use_desc_for_title=1&child_of='.$this_category->cat_ID);
echo "</ul>";
}
?>
</ul>
</li>
</ul>

This code will make a list of all our pages and subpages, as well as a last list element named “Categories”. When an user will hover top level pages (in case of a page menu) or top level categories, we will show up the related sub pages/categories.

CSS

Even if the code is fully functional, our script needs a good CSS styling. This CSS, which was taken from Darren Hoyt’s free Mimbo Theme, is perfect for what we want to do.

#nav{
background:#222;
font-size:1.1em;
}
#nav, #nav ul {
list-style: none;
line-height: 1;
}
#nav a, #nav a:hover {
display: block;
text-decoration: none;
border:none;
}
#nav li {
float: left;
list-style:none;
border-right:1px solid #a9a9a9;
}
#nav a, #nav a:visited {
display:block;
font-weight:bold;
color: #f5f5f4;
padding:6px 12px;
}
#nav a:hover, #nav a:active, .current_page_item a, #home .on {
background:#000;
text-decoration:none
}
#nav li ul {
position: absolute;
left: -999em;
height: auto;
width: 174px;
border-bottom: 1px solid #a9a9a9;
}
#nav li li {
width: 172px;
border-top: 1px solid #a9a9a9;
border-right: 1px solid #a9a9a9;
border-left: 1px solid #a9a9a9;
background: #777;
}
#nav li li a, #nav li li a:visited {
font-weight:normal;
font-size:0.9em;
color:#FFF;
}
#nav li li a:hover, #nav li li a:active {
background:#000;
}
#nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li.sfhover ul, #nav li li.sfhover ul, #nav li li li.sfhover ul {
left: auto;
}
a.main:hover {
background:none;
}

Javascript

Modern browsers (Safari, Firefox, Opera, and even Internet Explorer 7) will not have any problem with the :hover pseudo-class on li elements. But as we can easily guess it, the obsolete IE6 can’t deal with that.

In order to make our script compatible with IE6, we’ll need to charge this little unobtrusive Javascript code, in the head section our our HTML document, or even better, in a separate .js file.

<![CDATA[//><!--
sfHover = function() {
var sfEls = document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=” sfhover”;
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(” sfhover\\b”), “”);
}
}
}
if (window.attachEvent) window.attachEvent(”onload”, sfHover);
//–><!]]>

Now, your new drop-down menu is ready and will give your blog a professional look.

Digg This! | Stumble it! | Add to Del.icio.us | | Print This! |

Yesterday I wrote a post titled When Has Stealing Content Gone to Far?   At the time of publishing that post, I wasn’t really sure how it would be received because of the subject matter.   So far all feedback has been pretty positive, so I decided to write a quick follow up post talking about how to deal with getting your content stolen.  Thanks to Laurence for the idea.

As most people should know, when you publish content, pictures, or whatever else on the internet, there is always some risk that things will get scraped or stolen completely from your website/blog.  Despite everything falling under copyright protection, people sometimes get away with it because it is often difficult to enforce. 

So, what can do you to deal with content theft?  Here are two things readers suggested that may help:

  1. Terms and Conditions - Create a clear terms and condition policy that is findable on your website.   It may not help, but it certainly can’t hurt anything.   Throw it in the footer of your blog or somewhere that it is accessible. 
  2. Use Internal Links in your Posts - In addition to the SEO benefits of working on your internal linking structure, scraped and sometimes stolen content will often include these links back to your website.  

Hopefully those methods will help avoid this in the future, but what can you do when your content has already been stolen? 

  1. Contact the Offender - Depending on the situation, some sites may have a contact form or some way to contact the thief.   You can also try checking the domain whois records.  This is a good way to request they delete your stolen content and stop stealing your content in the future.   Though most know they are doing so, a few might not be aware that this is illegal.
  2. Take Action Against the Offender - If the first option doesn’t yield any results or there is no way to contact the owner, there are two ways to take action against the thief.   If they use Google AdSense to monetize the site (most do), you can report them to Google by clicking on the “Ads by Google” link in the lower right corner of the AdSense box and provide them feedback.  I believe stolen content is actually one of the default options you can check.   The other thing you can do is contact the hosting company and let them know they are hosting websites that are doing illegal practices.  I’ve heard of people have some success going this route, so it is a great last resort. 

So, that is what I have.   What do you do to deal with scrapers and content thiefs?

P.S.  Ironically enough, unless there is some sort of screening process that I’m not aware of, this post will be scraped at least 3 times shortly after publication.   Am I the only one that finds humor in that?

Digg This! | Stumble it! | Add to Del.icio.us | | Print This! |