WordPress plugins, themes, tips and hacks

Archive for the ‘Tips’ Category

Make sure WordPress doesn’t switch to the default theme

Monday, February 11th, 2008

Have you ever been working on your WordPress blog’s design, when you refresh the page only to find that it’s decided to revert to the default theme?

This has happened to me pretty often, and apparently I’m not the only one. Mark O’Neill says that his WordPress blog would revert to the default theme overnight while he was sleeping!

He did a search, and found this post on the topic, that explains that this glitch introduced itself in WordPress 2.2. A WordPress moderator on a forum topic related to this issue explained the problem as follows:

The root cause is that Wordpress reverts to default in certain cases where it cannot find the theme. A lot of conditions are known to cause this to happen falsely. For example, if the filesystem is slightly flaky, then there are instances where it may return an error incorrectly, causing Wordpress to reset to default. Another case is where somebody accesses the site at the exact moment you’re uploading a modified version of the theme.

The moderator goes on to say that it’s not a WordPress problem, so they’re not going to try to fix it:

Currently, there is no fix for this problem from the Wordpress side of things, because it’s not necessarily an issue with the Wordpress code. Wordpress is doing what it was designed to do. What’s happening is that Wordpress is getting false error codes and responding to them in unexpected ways.

One of the members on the forum pointed out that the problem only began when they upgraded to WordPress 2.2, and another member, justkristin, said that this avoidance of responsibility was unacceptable:

I have to say that, while I will continue to use WordPress because it is superior to everything else out there, I cannot help but be confused by the assertion that it is not WordPress’ problem. If I drove a car which, whenever I was in an accident, forcibly changed the clothes I was wearing, I would find that to be a problem with the car no matter who caused the accident. How can the resetting to default of a theme be a proper reaction to any server error?

The solution, as discovered by another member, tmuka:

  1. Rename your theme’s folder to default.
  2. Optional: delete all other themes from the server.
[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Using WordPress comments as a contact form

Monday, February 4th, 2008

Justin Tadlock has posted a way to use built-in WordPress comments in lieu of a contact form. Basically, you replace your theme’s current comments.php file with the one that Justin offers for downloading that checks if a page is called “Contact.” If it is, the comments stay hidden on that page. You can change the comments.php file so that other pages on your site will also hide comments.

Then you can create your contact page which will display the comment form, but any comment submissions will stay hidden.

The advantages:

  • Don’t need to use another plugin
  • Don’t need to tweak a plugin
  • Can theoretically manage all contact form submissions from your site rather than via email.

The disadvantages:

  • Submissions are actually comments, so they end up in your comment queue. If you have a lot of comments on your site, that can get hard to manage.
  • if you ever change themes or your “comments.php” file, then your comments on your “Contact” page will no longer be private. This can be solved by deleting all of these types of comments, which I personally don’t like because I like to save letters from readers; or using this solution forever, which is kind of a long-term commitment.

It’s an interesting idea, and worth considering.

Even Simpler WordPress Contact Form

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

How to add a tabbed interface to your WordPress blog

Thursday, January 24th, 2008

Headsetoptions has a great review of the types of tabbed interfaces available, and a tutorial on how to add one to your WordPress blog.

A tabbed interface is one of those boxes that you often see in the sidebar of a lot of premium themes where you click on tabs at the top, and it shows you different types of information in the same space. The main benefit of tabbed interfaces is that it helps save real estate on your blog, which can be pretty limited. Here’s an example from Solostream’s Premium WordPress Magazine Theme:

Tabbed interface on Solostream Premium WordPress Magazine Theme

Solostream also has a tabbed interface for the feature article section in some of his other premium themes.

Basically, there are three tabbed interfaces available: DOMtab, Tabber, and Tabs. The main difference between the tabbed interfaces are ease of use, and whether you can use them for commercial purposes.

Update Jan. 26, 2007: Another tabbing method that wasn’t mentioned on Headsetoptions is Yahoo! UI Library: TabView.

Check out the full post for the whole shebang: Anatomy of a Magazine Style Premium WordPress Theme - Part 2: DOMTab, Tabber, more

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Display your web identity with the ShowYourself Widget

Monday, January 21st, 2008

The challenge is coordinating all of the places that we appear on the web. Previously we discussed possible ways to combine your blog with facebook. You could also use add the ShowYourself Widget to your blog sidebar, which allows you to collect and display your online identities on various community sites in one place. Here’s a sample:

ShowYourself Widget

ShowYourself Widget

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

10 steps to a more splog-free WordPress blog

Wednesday, January 16th, 2008

Last Thursday, I realized that this blog was being scraped. I’m sure it was being scraped before, but I never really wanted to spend time looking into it. A blog takes so much time to write and manage, that I didn’t want to add another task to my blogging plate.

But now that I have seen the sploggers in action, I realize how truly irritating and damaging sploggers are. But I guess that’s the case with all theft.

Anyways, I turned to you, my readers, to get your advice, and I got some amazing tips from the people that responded. I also did a little extra searching around, plus Darren Hoyt wrote a post with some good links in it, so here’s a summary of 10 ways to stop sploggers.

Part 1: 4 5 ways to find out if you’re being splogged

  1. I found out about one of the scrapers via FeedBurner’s Uncommon Use feature. When you’re checking your feed stats in FeedBurner, make sure to keep an eye on the Uncommon Uses section to see if any sites you’re not familiar with are showing up. Jonathan Bailey from Plagiarism Today also has a detailed post on this subject.
    Feedburner Uncommon Uses
  2. Use the Copyfeed WordPress plugin, or any other plugin that adds a footer to your feed, and add a link back to your site in the footer. This way, if a splogger publishes your complete posts on their site, you’ll get Incoming Link notices in your WordPress dashboard.
  3. Lorelle has a bunch of steps and plugins that you can use to identify content theft.
  4. Use the Digital Fingerprint WordPress plugin. This plugin places a customized digital fingerprint into blog posts, which is only visible in the feed:”Once embedded in your post, the plugin allows you to quickly and easily search the blogosphere for references to the digital fingerprint using Google Blogsearch, BlogPulse, and Sphere…It also allows the quick and easy search for your digital fingerprint of the web itself using Google, Yahoo!, and MSN. An optional quick search can be included in the dashboard itself…Lastly, the plugin provides a few resources and links to places that will help you combat splog and spam should you find your content plagiarised or stolen on another website.”Talk about comprehensive!
  5. Update Jan. 23, 2008: Joost de Valk explains five more ways that you can search around the web for your URL and feed URL to find instances where your blog is being scraped.
  6. Update Feb. 24, 2008: Jacques left a comment here suggesting using Copyscape to track down sploggers.

Part 2: You’re being splogged? 10 ways to stop ‘em

  1. Alyk says to contact the sploggers and ask them to stop. This may sound simple, but it’s a great way to start…as long as the sploggers have left their email addresses or a contact form on the site. In my case, they hadn’t.
  2. Blaine, Jonathan and Jacob all suggested complaining to Google if the splogger is using Google Adwords to monetize the site. Jacob sent the following links:Easy: report them as spam to Google here:
    https://www.google.com/webmasters/tools/spamreport?hl=enHarder: submit a dmca complaint to Google:
    http://www.google.com/dmca.html
  3. Lorelle gives six steps that you can take to stop sploggers, such as how to contact them, and who to contact if they don’t respond. She also says what NOT to do.
  4. Ryan pointed me to a thread on SitePoint where a guy’s whole site was being lifted, design, database and all. The guy comes up with a creative piece of code that appears on the copycat site insulting the current owner, but it’s not a perfect workaround. He explains how he found out about this:

    I just noticed that a few of the pages visited were mywords.info/… rather than teleclick.ca/… If the owner of MyWords hadn’t been stupid enough to keep my StatCounter code on his copy of the site, I might not have found out about it for months.
    The surest way to locate mirrors of your website, however, is simply to invest a few minutes a week Googleing selections of your own content and checking for ripoffs. You’ll likely find plenty of stolen content from your sites if they’re popular enough, and can ask the re-publishers to remove it, or give you proper credit, depending on your policy.

  5. I checked one of my scrapers’ page source and noticed that they’re using FeedBurner to track their feeds, and scraping my FeedBurner feed (as opposed to the regular site feed). They’re also using Google Analytics to track site stats. I haven’t done this yet, but I plan on contacting FeedBurner and Google about this user. I’m guessing Google will have a particular interest in making sure that FeedBurner feeds aren’t being abused.
  6. A few readers suggested filing DMCA (Digital Millenium Copyright Act) notices with the host of the splogger, but aside from the fact that I suspect that this is about as effective as the paper it’s written on, it doesn’t apply to non-Americans. So if the splogger or splogee is not American, it seems this won’t apply.
  7. Use the Copyfeed WordPress plugin (see step 1 under Part 1 above), or any other plugin that adds a footer to your feed. I use Copyfeed, since it allows you to do a whole bunch of useful things to your feed, but most important I have put a copyright notice in my feed footer with a link back to my site. This way, at the very least, if someone finds my content elsewhere on the web and they like it, they can easily find my site. Another similar plugin that does the same thing is Joost de Valk’s RSS Footer plugin. Joost’s plugin automatically adds a link back to the original post in the footer as well. (Hat tip to Glenn Dixon for that one.)
  8. Some people suggest using the FeedEntryHeader WordPress plugin which adds a copyright statement and a link to the original article to the top of your feed entries. However, I’ve seen quite a few sites appear in Google Alerts where the excerpt from the post being cited is a header stating that if you’re reading this post off-site, it’s being scraped. But we want Google to scrape our sites and recommend it to others, and having that text appear in the Alert is not so user friendly.
  9. The AntiLeech WordPress plugin is for those of us who don’t just want to stop sploggers, but want to get back at them as well. AntiLeech doesn’t prevent sploggers from accessing your site; “it produces a fake set of content especially for them that includes links back to your site (and [his], too, ok?) and sends it only to them.”
  10. Only publish a partial feed. This way, if your feed is scraped, readers who want to read the whole thing will be forced to click on the “Read More” link, and will be taken to your site. The drawback? Now your feed will be a partial feed. I know that I personally don’t have patience for partial feeds, and I don’t read them, since what’s the point of having a feed if you’re forcing me to visit your site? There’s a reason I’m using feeds, and it’s because I don’t have time and patience to open up every post in its own window. Since I feel this way, I really wouldn’t want to do that to my readers. And anyway, does everyone have to suffer because of a bunch of miserable, blood-sucking sploggers?

Even with all the steps above, I suspect that the sploggers will always retain the upper hand and we will never be able to completely stop them, or any of the other dark and sleazy types lurking on the web. If we could visualize the web, I bet the dark part takes up the majority of the web, and is probably growing faster too since it’s so much easier to crank out stolen or lowest-common-denominator content than good, useful, high-quality content.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Advanced Dork Firefox add-on gives you right-click access to Google search options

Tuesday, January 8th, 2008

When developing blogs or sites on WordPress, we often have to search for information or need help solving a problem, and in those times many of us turn to Google. Did you know that Google has zillions of ways that you can focus your searches and make them even better? The major drawback is that you have to remember zillions of queries in order to do that, and in the end it’s just so much easier to do a regular search and see what you get.

That’s when Advanced Dork Firefox Add-on comes to the rescue! All you have to do is right-click it in Firefox, and you get a whole myriad of Google search options.

Here’s what the download page says about the Add-on:

Advanced Dork: Main Functions:

  • Highlight any text, right click, and choose from over 15 Advanced Google Operators. This function can be disabled in the options menu.
  • Right click anywhere on the page with no text selected to be provided with the active pages HTML title for use with Google’s intitle Operator, and the active pages HTML ALT tags for use with Google’s allintext Operator. This function can be disabled in the options menu.
  • Right click on a link and choose from site: links domain, link: this link, and cache: this link. Site: links domain will only search the domain name, not the full url.
  • Right click the URL Bar (aka Address Bar) and choose from site, inurl, link, and cache. Inurl works with the highlighted portion of text only. Site will only search the domain name, not the full url.

Sound good? Visit the Advanced Dork download page to learn more and get the Add-on.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Problem with class.php when upgrading to WordPress 2.3.1

Wednesday, December 19th, 2007

We just upgraded a client’s site from WordPress 2.2. to WordPress 2.3.1. After upgrading, the theme still worked, but the links to Pages in the upper navigation bar stopped working and they all linked to the home page instead of to their pages, and an annoying error appeared at the top of every page as follows:

Warning: Invalid argument supplied for foreach() in /home/wallis3/public_html/wordpress/wp-includes/classes.php on line 92

In case anybody else ever encounters this problem, I found the solution after a bit of digging here in this WordPress support forum topic. It seems that some servers don’t deal well with blogs on WordPress 2.3.1 with permalinks that use /%category%/ as part of the permalink string. The server this particular site was sitting on happened to be Lunarpages.

Anyway, we removed /%category%/ from their permalink structure and updated everything in the site. Luckily the site wasn’t that old and didn’t have that much content, but it was still annoying. Update: All we had to do in the end was select the default permalink structure, click “Update Permalinks”, and then select the permalink structure that we wanted, including /%category%/, and update again, and that worked. It seems that this is a WordPress bug, and the moderators on the above support forum topic recommended submitting a bug report to WordPress, but there are so many rules to follow to submit a bug report that in the meantime I’m going to pass.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Changing where WordPress saves your uploaded images and files

Thursday, November 29th, 2007

In my previous post on using thumbnails with WordPress’ custom fields feature, I explained a way to change where WordPress saves images and files you upload from the Write Post/Page page. Generally, any images or files you upload while writing a post are saved on your server under wp-content/uploads in folders that are organized by month and year, i.e. wp-content/uploads/2007/03.

Uploading files on Write > Page in WordPress admin:

Uploading files on WordPress write post page

I explained that you could use a plugin called Filosofo Old-Style Upload Plugin to change where files are saved on your server.

Well, Ryan Hellyer pointed something out that I can’t believe I never noticed: you can change where and how files are saved in WordPress!

Many of you are probably saying “Duh!” But I really never noticed this, so please humor me.

To change where your uploaded files are saved on the server:

  1. Go to Option > Miscellaneous in your WordPress admin
  2. Under Store uploads in this folder, enter the file structure that you want. For example, wp-content/themes/themename/images.
  3. Where it says “Organize my uploads into month- and year-based folders”, you can unselect the check box so that all images will be saved in the one folder you specified in step 2.
  4. Click on Update Options to save your new setup.

Change file upload options in WordPress

I can’t really see any advantage to saving the images in folders according to year and date, so I would make this change right from the beginning of any WordPress blog.

[By the way, did you notice my snazzy new screenshots? Until now I've always hesitated to add screenshots because I was using a free but not-very-efficient screen capture tool. But now I'm using the free and amazing SnagIt from TechSmith. If you haven't heard, TechSmith is offering older versions of their SnagIt and Camtasia Studio software for free! If you want to upload to their most recent version, it's only half price once you've downloaded these older versions!

They are both so great, that you really should download them, even if you don't think you'll have any use for them right now. Go to Quick Online Tips for information on how to download and get the license keys.]

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Images, thumbnails and custom fields in WordPress

Monday, November 26th, 2007

I’ve learned a lot about custom fields since I posted about programming thumbnails into your WordPress theme with custom fields, thanks to everyone’s comments here and on weblog tools collection, who referred to my post. I decided to collect all the links posted in the comments here so that we all have easy access:

Custom Fields + Images

Plugins + Images

  • Don’t want to mess with your code and custom fields? Justin also created a plugin for WordPress theme designers that allows them to easily display their themes with thumbnails, description, and demo and download links.
  • Yet Another Photoblog (YAPB) plugin takes your plain ol’ WP blog and extends it into a whopping photo blog with a ton of features, like easy image upload and on-the-fly thumbnail generation. I’ve never tried it, so if you have, I’d love to hear feedback.
  • Photopress is another image management plugin that says it adds a pop-up uploader and a pop-up image browser to the posting page, a random image function for your template, and a simple album to display the photos you’ve uploaded.
  • The Post Thumbs plugin claims it will also do the thumbnail thing for you. The reason I say claims is because I have a feeling I tried it out at some point without success. But maybe it will work for you.
  • MIA Wordpress Plugin page is in Spanish (I think) so I don’t really know what it does, but after using Google Translator (thanks Ryan!) it seems that it places random images from your blog wherever you put the code in your template. It’s supposed to be a local FlickrRSS, I think.

Between custom fields and these plugins WordPress can really become a platform for eye-catching sites and blogs.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Giving each WordPress post a thumbnail, and display the thumbnail on the home page

Wednesday, November 21st, 2007

You may encounter situations where you need to automatically display a thumbnail or image of some kind that will link to posts. Here’s an example of this kind of situation: you want to display recent posts from a certain category on your home page, with a thumbnail for each post and maybe the title and an excerpt. Or, I recently had a client that had a box on their homepage for multimedia where they wanted an image to appear that would represent the latest post in the Media category and would link to that post. A link to this site is at the end of this post, so read on.

I found the solution in two amazing WordPress themes: Mimbo and The Morning After. They both use thumbnails on their home page, and they do it by using WordPress’ mysterious Custom Fields feature.

You need to be able to upload images to your server in order to do this. You can do this via FTP, but to make this as easy as possible for clients, I use the Filosofo Old-Style Upload Plugin which creates a link on your nav bar where you select files for uploading. But first you need to configure this plugin and select a folder where all uploads will be saved:

  1. Upload the plugin and activate it.
  2. Go to Options > Uploads.
  3. Enter your destination directory. I think the best is to use your images folder in your theme folder so that any images you upload will be in an easily portable place. So the path could be something like /home/server/public_html/wp-content/themes/themefolder/images. The plugin will suggest a path, and it is usually right.
  4. Enter the URI of the folder. It’s something like http://www.yoursite.com/wp-content/themes/themefolder/images.
  5. You might as well up your maximum file size. I make it 500 kb.
  6. Allowed file extensions: jpg, jpeg, gif, png, pdf - I add PDF and other types of files I think clients may want to upload.
  7. Minimum level to upload: I leave it at 6 since I have no idea what this means.
  8. Click Update Options.

That’s done. Now for how to create a post with a thumbnail image.

  1. Create an image for your post with the right width and height. The size of the image depends only on the design of your site and where it is going to appear.
  2. Go into the admin of your site. Click on Upload (it’s on the upper nav bar).
  3. Select the file you are uploading, select No Thanks so it won’t create a thumbnail, give it a description (that’s good for Google) and click Upload File.
  4. Once it’s uploaded it will show you the entire URL of the image. Note particularly the last part of the link where it says the name of your image, especially if there are any capitals in any part of the name. You will have to enter the exact file name in step 8.
  5. Go to Create Posts. Enter your post and title as you wish. Make sure to select the category you have selected as the one that will appear with the thumbnails. Now scroll all the way down to the bottom of the screen where it says Custom Fields. Click on the plus button to expand it.
  6. Enter the word Image (with a capital I) in the Key field.
  7. In value, enter the exact name of the file you uploaded. For example picture.jpg or image.gif. Click Add Custom Field.
  8. Save your post.

Now we need the code that will make this thumbnail appear where you want it to appear. Following is the code for having a thumbnail appear with the title underneath it. This code is adapted from the Mimbo theme, but the code in The Morning After is similar:

<?php
// this is where the Features module begins
query_posts('showposts=1&cat=199'); ?> //change the showposts number to the number of posts that you want to appear, and change cat=199 to your category number, which you can find out by going to Manage > Categories
<?php while (have_posts()) : the_post(); ?>
<div class="thumbnails"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php echo get_option('home'); ?>/wp-content/themes/themefolder/images/<?php
// this is where the custom field prints images for each Feature
$values = get_post_custom_values("Image"); echo $values[0]; ?>” alt=”" /></a>
<p class=”title”><a href=”<?php the_permalink() ?>” rel=”bookmark”>
<?php
// this is where title of the Feature gets printed
the_title(); ?></a></p></div>
<?php endwhile; ?>

Wanna see an example? Check out this site, scroll to the bottom and look at the left-most column that is called Media. That image there is a thumbnail that was uploaded and entered in the Custom Field of the post it links to.

Update Nov. 27, 2007: This post got a lot of comments here, and on Weblog Tools Collection who referred to it. Lots of people gave more recommendations on how to manage thumbnails with custom fields and/or plugins, so I collected these tips into one post which you can see here: Images, thumbnails and custom fields in WordPress.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Premium News Themes