Archive for the ‘WordPress Tips’ Category

I was initially excited about the CodePress syntax highlighting in WordPress 2.8, although after actually using it recently, I changed my mind. While just the syntax highlighting alone is not a problem, the way it completes quotes, and auto indents makes it somewhat annoying to say the least.

I asked on Twitter, and found a thread on the WordPress.org support forums, but unfortunately couldn’t find a solution on either. It turns out the solution was actually a lot simpler than I thought. Watch this quick video to see how to disable it:

As a quick outline, here’s what you have to do:

  • Login to your WordPress 2.8 admin panel
  • Navigate to either the theme or plugin editor (doesn’t matter which)
  • Click the “Screen Options” tab located in the top right corner
  • Then click the “Disable syntax highlighting” link

To enable it again, follow the same steps and click the “Enable syntax highlighting’ link instead. Another method of disabling/enabling is to append ?codepress=off or ?codepress=on to the end of the Theme Editor URL.

Hat tip to Eric Sizemore (as mentioned in the video) for pointing this out to me.

Subscribe to RSS

By: Leland on Jun. 13

Bookmark and Share

I’m not sure if this technique has been around a while or what, but I’ve just noticed it. Someone just tried to leave a comment on older post here at Theme Lab with the usual “nice post thanks” and a :) smiley as the anchor text (or image in this case).

How It’s Done

These comment spammers prey on unsuspecting WordPress users by linking to their site with a smiley image like this.

Wow! Really awesome post! <a href="http://example.com">:)</a>

The smiley is then parsed into an image, which is then displayed in your WordPress comment moderation panel.

How To Spot It

In the comment moderation panel, under the smiley image you’ll notice a small, barely noticeable, underline.

WordPress Smiley Spam

This indicates the smiley is linking to something, most likely a site you wouldn’t approve of.

Conclusion

I guess spammers will never stop of thinking of new ways to spam, but it’s best to be aware of the new techniques as they come out. Have any of you seen this type of comment spam before?

Subscribe to RSS

By: Leland on Sep. 3

Bookmark and Share

If you’re a WordPress theme author of multiple themes, then you’ll probably want a more efficient way of handling “live demos” than setting up a brand new WordPress installation on each. I personally use the theme switcher plugin on my live demo site. What this plugin will allow you to do is set up a link to preview a theme installed in your wp-content/themes/ folder, whether it’s the active theme or not. This plugin also has a function which will make a dropdown list of all the themes installed on your blog, providing links to preview each theme.

Subscribe to RSS

By: Leland on Aug. 11

Bookmark and Share

On a WordPress site of mine, I was perplexed as to why it was not getting indexed in Google or other search engines.

I verified my site in Google Webmaster Tools and tried to submit a sitemap. In the webmaster tools panel, it informed me that my robots.txt file was blocking Google from grabbing my sitemap.

This confused me, as I know I would never knowingly make a robots.txt file to block search engines.

Read on to find out what the problem was, how to fix it, and how it happened in the first place…

Read the rest of this entry »

Subscribe to RSS

By: Leland on Jun. 22

Bookmark and Share

It was recently announced that WordPress.com blogs have XML sitemaps, which are automatically submit to search engines for better search indexing and optimization.

Now, most of you reading this are probably self-hosted WordPress users. How do you get your own sitemaps for your self-hosted blogs? This is where the Google Sitemap Generator plugin comes into play.

Contrary to the name, the plugin will actually automatically generate and submit sitemaps to not just Google - but also Live, Yahoo, and Ask. This will provide a similar automated sitemap solution, similar to the feature WordPress.com recently rolled out. More information on this plugin can be found in this WordPress SEO tutorial, an earlier article featured on Theme Lab.

Subscribe to RSS

By: Leland on Jun. 17

Bookmark and Share

One plugin which I use frequently on my WordPress development projects is the Top Level Categories plugin. What this plugin will do is remove the /category/ from the URL upon activation. For example:

http://www.example.com/category/uncategorized/ will change to http://www.example.com/uncategorized/

No other configuration to the plugin is needed, all you need to do is activate. This plugin is best used in combination with a permalink structure like /%category%/%postname%/.

Subscribe to RSS

By: Leland on Jun. 7

Bookmark and Share

If you get an error like this, there is a plugin or other function called in your theme which you don’t have. How do you fix this? There are a few ways: remove the code, error proof it, get the necessary plugin, or upgrade WordPress if necessary. In this quick WordPress tip post we’ll go over how to error proof these with a conditional tag and PHP function known as: function_exists.

If you get an error such as Fatal error: Call to undefined function the_title_attribute() you can simply replace any instance of the_title_attribute with the following:

<?php if (function_exists('the_title_attribute')) { the_title_attribute(); } ?>

In this case, you could also take it one step further by adding an else statement.

<?php if (function_exists('the_title_attribute')) { the_title_attribute(); } else { the_title(); } ?>

Before trying a new theme on a production site, make sure to preview your theme first, and then work out all the errors (if any).

Subscribe to RSS

By: Leland on Jun. 1

Bookmark and Share

You don’t need any custom queries or database calls just to get a list of recent posts. In fact, there’s a function built into WordPress that will do just that. It’s called, wp_get_archives(). You might recognize that as a way to display monthly archives, but with a few parameters, you can modify it to display a list of recently published WordPress posts. Here’s the code:

<?php wp_get_archives('title_li=&type=postbypost&limit=10'); ?>

What this will do is strip any WordPress added formatting and output a nice list of the 10 latest posts, each within it’s own <li> tag.

Subscribe to RSS

By: Leland on May. 26

Bookmark and Share

I know this tip may be very obvious to some, but I keep seeing “admin” as the author name on many WordPress blogs. I thought I’d write this quick tip post because these WordPress bloggers may not even know how to change the publicly displayed author name. Fortunately, this is very simple to do. In your WordPress admin panel, select Users -> Your Profile. On this page, enter whatever you want as your nickname, and click “Update Profile.”

WordPress Author Nickname

Once that’s done, select this newly created nickname from the “Display name publicly as” dropdown menu. Update your profile again, and that’s it.

Subscribe to RSS

By: Leland on May. 20

Bookmark and Share

If you want to test out a WordPress theme before it goes live on your blog, then I’ve found the perfect WordPress plugin for you. It is called Theme Test Drive. It’s very simple to use. Get the plugin from here at the WordPress.org plugin directory, install the plugin, and activate. On your design menu, select the theme you wish to preview from the dropdown menu and enable it.

WordPress Theme Test Drive

The theme will be visible to you (the admin) only. Make sure you disable any “cache” plugins before using Theme Test Drive, as it will likely cause problems. Enjoy!

Subscribe to RSS

By: Leland on May. 19

Bookmark and Share

Recent Comments

  • Anto: Hello. Thanks, you’ve got my contact details. Get in touch with me if your wanting something in your own...
  • Sonny: Hey Anto, I love this design, good work that I paid for link removal :) Anyways, how can one contact you to do...
  • Leland: @axelk: As in picture uploads? Not sure about that, although you could set up the form to allow users to send...
  • axelk: thank you for the reply. can Contact 7 be used to submit pictures as well?
  • Leland: @axelk: I think that’s what the Contact Form 7 is for. Although if you wanted to allow users to submit...

About The Author

Welcome to Theme Lab. My name is Leland, and I run the place. I write all the tutorials and code all the themes you see here on the site.

For more information about me, feel free to read the about page. If you want to drop me a message, feel free to contact me.

Interested in advertising on Theme Lab? We have advertising available at very reasonable rates. Head on over to the advertising page for further details.

Please read our Privacy Policy and Terms of Service in regards to theme usage.

© 2009 - Theme Lab - Powered by WordPress