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:
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.
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.
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.
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…
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:
Make sure your email address is in your user profile.
Put the following template tag wherever you want the address to appear:
The function antispambot() above parses the e-mail address passed by get_the_author_email() (this is the same asthe_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:
Since this pulls an author related parameter, will the email address change according to the author? (Probably.)
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.
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:
Log in to PHPMyAdmin via your control panel or however else you log in.
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):
Once you are sure you are in the right database, click on Export at the top of the PHPMyAdmin toolbar:
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:
Now on to importing: install WordPress on your new server.
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:
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).
Browse to find your exported database file. Leave the rest of the settings, and click Go.
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.
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.
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:
$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.
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.
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.
At the top of the page, there is a hyperlinked list of related features for plugins, like Related Authors, Admin, Stats, Posts, Tags, etc.
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.
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.
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.
There's lots of great stuff out there for WordPress. I put this blog together so that I would have a place to organize the best information so that when I need it, I can easily find it. What better way to do it than with WordPress?
Ryan Hellyer just pointed out that the comments feed here at WordPress Garage was not working, and apparently hasn't been working since the end of April. I wonder if it had to do with upgrading to 2.5...
Hi all - I was wondering if one of you can help us find a solution to a feature we would like to add to a WordPress site:
The site in question has multiple contributors. Most are dedicated to certain categories. We would like to automatically display on a category page only the authors who have written articles in that particular category.
For example, let's say we have a category called "Cucumbers" and a category called "Tomatoes." When someone clicks on the Cucumbers category we would like only the authors who have written posts categorized as Cucumber posts to appear, and on the Tomatoes category page, we would like only the authors who have written Tomato category posts to appear. There may be some overlap between the pages, since some authors may write posts for both the Cucumber and the Tomato categories.
One solution we thought of is to call the category we want and the number of posts from that category and then display the list of authors. The problem is it shows duplicate authors. Here's the code:
<?php query_posts('showposts=20&cat=3'); ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_author_posts_link (); ?>
<div style="clear:both"></div>
<?php endwhile;?>
Is there a way to prevent duplicate authors from appearing? Or is there a better way?
Ryan on the WordPress development blog (which is running on Prologue, very nicely I might add) has basically congratulated the "Farsi and Hebrew translation folks" for their hard work making the WordPress admin look good in right-to-left languages.
I'd like to take this opportunity to say that the Hebrew version of WordPress exists mostly, of not completely, thanks to Ran Hartstein. Ran always makes sure the Hebrew speaking audience gets their Hebrew version of WordPress as quickly as possible. Of course, the extended Israeli WordPress community adds a lot of value to the usage of WordPress, with many right-to-left themes, plugins, and the vibrant and helpful wpheb google group.
Security Focus has reported a security problem with the Search Unleashed plugin. The plugin stores search queries, but does not validate stored data and sends it back "raw" to the browser.