WordPress plugins, themes, tips and hacks

New CSS for aligning images, block elements and captions

August 19, 2008 – 11:19 am | by Miriam Schwab

I was recently working on a WordPress site, and I just couldn’t get my images to left-align with the text so that the text would wrap around it. It was wrapping in the text editor in the admin, but on the front end the image stuck out of the top of the text.

Rebecca, our genius Web Project Manager at illuminea, did a search and discovered on the WordPress Codex that a bunch of new styles are needed in your style.php file in order to get the images to do what you want from WordPress version 2.5 and up. If you are using an older theme, you may not have these styles in your style sheet. The same classes are used to align images that have a caption (as of WordPress 2.6).

Here are the styles - you can just copy and paste them into your style.css file or wherever your CSS styles are located:

.aligncenter,
div.aligncenter {
   display: block;
   margin-left: auto;
   margin-right: auto;
}

.alignleft {
   float: left;
}

.alignright {
   float: right;
}

.wp-caption {
   border: 1px solid #ddd;
   text-align: center;
   background-color: #f3f3f3;
   padding-top: 4px;
   margin: 10px;
   /* optional rounded corners for browsers that support it */
   -moz-border-radius: 3px;
   -khtml-border-radius: 3px;
   -webkit-border-radius: 3px;
   border-radius: 3px;
}

.wp-caption img {
   margin: 0;
   padding: 0;
   border: 0 none;
}

.wp-caption p.wp-caption-text {
   font-size: 11px;
   line-height: 17px;
   padding: 0 4px 5px;
   margin: 0;
}
[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

WordPress 2.7 heavily based on existing plugins

August 4, 2008 – 11:41 am | by Miriam Schwab

Weblog Tools Collection has published an overview of the features in store for us in WordPress 2.7. As I was reading the list, I noticed that many of them them are based on existing popular plugins, like the Google Sitemaps Generator, Better Comments Manager, YATCP (Yet Another Threaded Comments Plugin), and Subscribe to Comments.

I had mixed feelings about this: on the one hand, these plugin authors had enough vision to see a need and fill it with some plugins that became standards for experienced WordPress blog developers. If WordPress makes these features part of the core, than these plugins become legacy and are no longer needed, and all the developers will no longer get recognition for their innovation and leadership in the WordPress community.

On the other hand, these types of developments are par for the course in an open source community, and is what makes the WordPress software so fantastic. The people at Automattic give free rein to the community to develop new features, and then these features are tested by thousands around the world over many years, and “survival of the fittest” helps the community identify the best and most important features to be added to the WordPress core.

The result: one of the best pieces of open source software around, and a celebration of the culture of open source.

What do you think?

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

WordPress for iphone released, and other WordPress news

July 24, 2008 – 7:57 pm | by Miriam Schwab

There have been a few developments in the wonderful world of WordPress over the last little while. Let’s take a look:

  1. WordPress 2.6 was released. Nuff said.
  2. WordPress for iPhone app released. This would be exciting news, BUT I’VE NEVER TOUCHED AN IPHONE IN MY LIFE SINCE THEY DON’T SELL THEM IN ISRAEL. Whew. I feel better. Anyways, read about it here and here, and in a million other places.
  3. Remember the Theme Viewer, that organized place where you could go to browse WordPress themes, or find themes according to specific criteria like the color black? Well it’s back in action, so let’s just pray that those people from the underbelly of the Internet don’t show up and ruin everything for us again.

That’s the news. Now here are some handy links I came across over the last few days:

FreshPost plugin - a great way to add extra features to a WordPress site is by using Custom Fields. But the whole key-entering business doesn’t work so well with clients who just want one button they can press. This plugin solves that problem by allowing you to create custom write panels, add custom fields (images, drop downs, file upload, images, checkboxes, textareas, etc..), and automatically resize images.

WordPress Tips + Things You Can Do After Installing Wordpress - Digital Inspiration has published a handy list of things you can and should do after installing WordPress, like changing your default image folder, removing unecessary code, preventing people from casually browsing your WordPress Folders, etc.

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

Welcome back WordPress Press This bookmarklet! I missed you.

July 18, 2008 – 5:30 am | by Miriam Schwab

A few days ago, the folk over at Automattic released WordPress 2.6. This release was so ahead of time (apparently it was released a month early) that I feel like it snuck up on me.

First of all, kudos to all involved for getting out a new release ahead of time. And secondly, they’ve done a great job adding some really useful features and security fixes to this version. But the apple of my eye is the reinstatement of the Press This bookmarklet.

I know they’ve added all sorts of cool features like post revisions for multi-author blogs, easy insertion of image captions, and more user-friendly management of plugins; but I really liked the Press This bookmarklet, and kind of mourned its loss when it was removed from WordPress 2.5. The Press This bookmarklet makes it much easier to post about other web content on your own blog, in a way that’s similar to the Tumblr bookmarklet. Aaron Brazell describes the Press This bookmarklet as follows:

…it allows the user to be on any website, click the bookmarklet and get a miniaturized version of WordPress admin with options to snip text, photos from the page, quotes or video embeds.

I still haven’t upgraded (see below to find out why), so I wonder if the Link This bookmarklet has been reinstated too…

It’s not all rosy

Some bloggers have had problems after upgrading to 2.6. Joost de Valk warns WordPress bloggers using Windows hosting that the upgrade may mess up your permalinks. Upstart Blogger upgraded only to find that all of his categories and category permalinks had been messed up, despite the fact that he took all the necessary precautions like deactivating plugins, etc. Apparently he’s not the only one, either. He says that that there’s a solution, but it involves messing with your database, which is not for the fainthearted. Being a seasoned member of the fainthearted club, and having just moved all my blogs and sites from one host to another, I think I’ll wait a bit before upgrading, as usual.

More about WordPress 2.6

10 Things You Need to Know About WordPress 2.6 from Technosailer

WordPress 2.6 from WordPress.org

What You Need To Know About WordPress 2.6 from Weblog Tools Collection

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

Preventing email spam with the built-in WordPress email obfuscator

July 10, 2008 – 8:57 am | by Miriam Schwab

If you want to give people the option to contact you by email, you need to display your email address on your site. But by doing so, you are putting yourself at the mercy of the low-lives out there harvesting email addresses so they can spam you with products that will enlarge certain parts of your body.

There are solutions out there that use javascript and other stuff to “obfuscate” your email address, but why use something external when you can use the handy, shiny, built-in WordPress email obfuscating template tag?

To use this template tag, you need to do the following:

  1. Make sure your email address is in your user profile.
  2. Put the following template tag wherever you want the address to appear:
    <?php echo antispambot(get_the_author_email()); ?>

The WordPress codex says that this tag works as follows:

The function antispambot() above parses the e-mail address passed by get_the_author_email() (this is the same as the_author_email(), except it returns rather than displays the author’s e-mail address). Use of the echo command displays the output of antispambot(). An interesting feature is it encodes only portions of an address, and does so randomly so the letters encoded are different each time the page loads, adding a little more firepower to the spam protection arsenal.

My questions are:

  1. Since this pulls an author related parameter, will the email address change according to the author? (Probably.)
  2. Can this even be displayed in the sidebar?

It seems that if it is author related, it is not a good solution for displaying a website email address that does not belong to a specific person, like . But if you do have a multi-author site and you want to display the authors’ email addresses, this seems like a great way to do that without feeding the spam wolves.

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

6 things to remember when moving WordPress blogs to a different host

July 8, 2008 – 12:15 pm | by Miriam Schwab

I recently had to move all my WordPress sites and blogs to a new server because Bluehost sucks. My sites were going down on a near-daily basis for way too long, and they couldn’t care less. So I did what I really did not want to do, and moved six WordPress sites to a new hosting provider, which has proven itself with my clients’ sites: Hostgator. And along the way I’ve learned quite a few things about what to pay attention to when moving WordPress sites from one place to another, which I’d like to share.

Lesson 1: WordPress’ native XML export is not good enough

In WordPress, you can easily export a site by going to Manage > Export, which will create a unique XML file that you can import in any new site. This is fine for a very simple, single-user blog without heavy customizations. However, if your blog has multiple users, and if you have added info to their profiles, that info will be lost in this export. In addition, all users will be given a permission level of Subscriber, which is annoying if you need to go and change everyone back to their original permission level.

Also, if you have installed plugins that created new tables in your database, these will not be exported.

And, if you had any links saved, this will not save your links. See Lesson 6 below for more information on this, but the point is that the only way to save your links AND their categories is to export your entire database.

Therefore, in order to retain all settings and information that your site needs, the only way to do so is to export your entire database, and then import it to the new WordPress installation.

Exporting and Importing a WordPress blog

Here’s how you export and import your WordPress database. WARNING: Messing with databases in PHPMyAdmin can be hazardous to your health and to the health of your site. One wrong move and everything will be but a distant memory. So make sure to backup like crazy; and I take no responsibility for any harm you may come to by following my instructions. Now, let us begin:

  1. Log in to PHPMyAdmin via your control panel or however else you log in.
  2. If you have multiple WordPress blogs on one server, you may see a list of databases in the left-hand sidebar. Make sure you are dealing with the right database. The way that I check which database is the right one is by browsing the database and viewing the information there, whether it’s posts or even meta data like the blog name. To browse, click on the browse icon next to a table’s name (Note: your PHPMyAdmin interface may look a bit different, depending on the version you are using):
    Browse database tables in PHPMyAdmin
  3. Once you are sure you are in the right database, click on Export at the top of the PHPMyAdmin toolbar:
    Export database in PHPMyAdmin
  4. On the Export screen, I usually leave all the settings as is, but I do make sure to to 2 exports: a compressed (gzip) export, and a regular export, just in case. So export one while selecting None, as shown below, and one while selecting gzipped:
    Compress export file in PHPMyAdmin
  5. Now on to importing: install WordPress on your new server.
  6. Go in to PHPMyAdmin for your new server, and delete all your tables for your new WordPress installation (Yikes!). In PHPMyAdmin, to delete is called to “drop.” So on your main database page, select all your tables and click on Drop, or on the red Xs next to the table names:
    Drop tables in PHPMyAdmin
  7. Now, import your exported WordPress database into your new installation. To do that, stay in PHPMyAdmin for your new site, and click on the Import tab that is to the right of the Export tab on the toolbar (see image in step 3 above).
  8. Browse to find your exported database file. Leave the rest of the settings, and click Go.
  9. Now your old WordPress database is in your new installation. It may work at this point, so go check. If it does, great. If not, continue reading.
  10. You need to make sure that your database table names work with the new installation of WordPress. This means the following: if you installed your old database with Fantastico, all your database tables have a prefix of wp_. If you didn’t install it with Fantastico, the database tables probably don’t have a prefix. Your new database tables may have a different naming convention depending on how you installed it. So, take a look at your database table names, and note if they start with wp_ or not. Now it is time to open wp-config.php.
  11. Once you have opened wp-config.php, look at line 16, which says something like this:
    $table_prefix = ‘wp_’;
    If your database tables start with the wp_ prefix, leave the line as above. If they don’t have a prefix, change it to:
  12. $table_prefix = ”;

Now your blog should mostly work (I hope)! But there are a few more things that we need to take care of:

Lesson 2: Widgets are not preserved with an XML backup, even with a full database backup

If you are using widgets somewhere in your blog, you will have to redo them one by one on your new blog if you use the XML backup. So take out a pencil and paper, and write down exactly what widgets you are using, what order they’re in, and any modifications or customizations that you made to them. Ok, you can use Word or Notepad if you want, but that’s about as technologically friendly as you can get.

Lesson 3: In addition to backing up your theme and plugins folder, remember your Uploads folder!

In your blog under Settings > Miscellaneous, you have set where any uploaded files or images will be stored. Make sure to backup that folder, in addition to your theme and plugins folder, so that you will have all those files in your new blog. In your new blog, go to Settings > Miscellaneous and make sure it’s pointing to that re-uploaded Uploads folder.

Lesson 4: Make a note of your site’s permalink structure

You want to retain the same permalink structure for your new site so that you can continue to enjoy the same traffic you had before from search engines and incoming links. So make note of your permalink structure, and once your new blog is installed, make sure to go to Settings > Permalinks, and set the same structure there.

Lesson 5: Don’t forget your favicon

Your favicon can get lost in the shuffle. Make sure to back it up, and upload it to your new site.

Lesson 6: It is hard to preserve WordPress blogroll links and their categories

Here at WordPress Garage, I had a page until recently called “Links we Love.” I had painstakingly added, categorized and described many links that I thought were useful to my readers. Well, during the whole server move, the links got lost because we didn’t export them by going to http://wordpressgarage.com/wp-links-opml.php, and saving that OPML file as a text file for importing later. In any case, even if I had saved that and imported it here, I would have lost all my categories anyway. So just note that if you’re depending on the XML backup, you will lose all your links. If you back up your links with the OPML file, you will lose your categories.

——————-

To sum up: try not to ever have to move your WordPress blog from one server to another, and you will add years on to your life.

Happy blogging!

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

Social Proof: Increase subscribers to your blog by displaying your feed stats

June 12, 2008 – 4:49 pm | by Miriam Schwab

Last night I attended MashBash Tel Aviv, an intimate gathering of Mashable’s Adam Hirsch and 800 of his closest friends from the Israeli hi-tech industry. In between having fun and getting served free drinks for three hours, I managed to learn something new. I learned about “social proof.”

Social what?

I met a guy at the event who I “knew” through twitter. Harry runs a snazzy new website about Jerusalem attractions and other stuff. We were discussing the right steps to take to increase blog traffic, and how he’s managed to get really decent traffic to his site in a relatively short period of time. He mentioned one tip that I had never heard before in all my blogging years, and it struck me as so simple yet so smart.

Social Proof.

Harry said that once you have at least 50 RSS subscribers, you should display the number of subscribers on your blog to encourage others to subscribe as well. The reason is that people like to try out things that lots of other people like. Think of a restaurant or cafe - if you’re walking down a street of cafes, would you rather go into the empty cafe, or the one overflowing with patrons? When lots of people patronize something, by showing up, subscribing, or in other ways, it encourages others to join as well.

(Harry learned this tip from Yaro Starak’s Blog Mastermind Course, which actually sounds like it might be worth the investment from what he says.)

So take a look over to your right here. See that little feed reader thingy? As you can see, WordPress Garage has 781 subscribers. We’re a really cool crowd, having lots of fun. Doesn’t that make you want to subscribe too?

You can subscribe to the feed, or via email in the sidebar.

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

I want a WordPress plugin to…

June 11, 2008 – 7:58 am | by Miriam Schwab

So you’ve got a shiny new WordPress blog, and you really want to add a cool feature that either demands programming the feature into your site, or even better, finding the perfect plugin so that you can add the feature with a few clicks.

The conventional way of finding plugins is to either search the WordPress plugin directory, or to do a search. Well, here’s a new way that is actually really smart and useful - visit this site: I want a WordPress Plugin to … 450+ solutions.

At the top of the page, there is a hyperlinked list of related features for plugins, like Related Authors, Admin, Stats, Posts, Tags, etc.

450+ WordPress Plugins

You click on one of those links, and it takes you to a list of plugins that can help you achieve that feature. So for example, if I click on Calendars, I get a list of 4 plugins that can help me add a calendar to my WordPress blog. I personally know that there are many more calendar-related plugins for adding calendars to your blog, but you can submit more plugins for them to add to the list.

I think the idea behind this site is good, but it really needs a lot of community contribution in order to make it more complete.

I want a WordPress Plugin to … 450+ solutions

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

Get to know every line of your comments.php WordPress theme file

June 3, 2008 – 10:43 pm | by Miriam Schwab

There is one WordPress theme file that I almost never touch when working on a theme: comments.php. I usually style WordPress comments via the CSS sheet, and that’s that.

Well, there’s a lot you can do to customize and extend WordPress comments if you just know how. Nettuts has published a comprehensive tutorial on how the comments.php file works, and what every line of code does. The tutorial also explains how to add extra goodies to your comments, like Gravatars, comment numbers, comment links, alternating colors (which we’ve discussed here), displaying the HTML tags users can use in the comments text box, and displaying a link to the comments RSS feed. The tutorial did not discuss how to give each comment its own link, a tip that I find particularly handy for referring to specific comments.

Check out this tutorial if you want to strengthen your relationship with your WordPress comments.

Unraveling the Secrets of WordPress’ Comments.php File

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

When a WordPress plugin for foreclosures is released, you know it’s a recession

June 3, 2008 – 9:30 pm | by Miriam Schwab

I always think I’ve seen everything, until something even crazier comes along. Foreclosure.com, a site that lists nationwide foreclosure data, has released a WordPress plugin that adds foreclosure listings to their Web sites.

The WordPress Foreclosure Listings Plugin delivers a complete real estate search and navigation environment quickly and easily by querying the Foreclosure.com database in real-time. Once a partner activates the program, the plugin will automatically create a WordPress page and a search widget.

This has got to be one of the most depressing plugins in existence. Profiting from people who are getting kicked out of their homes seems cruel. We know banks do it, but banks are cruel so it suits them.

When the vultures hover like this, it makes me think that maybe we are heading towards a recession, and maybe it really has already hit the US. Scary.

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