Home About the Book About the Authors Handy Links

Customise the WordPress Search results page

Miraz.

Another in my series of Peachpit Web Design Reference Guide WordPress articles was published the other day — Customizing WordPress 2.5.1: Search:

After arriving at your blog, visitors may want to search for specific items you have written about. Make sure visitors have easy access to Search and that results are useful to them. This article, based on WordPress 2.6.1, shows you how to make sure visitors find what they’re looking for on your blog.

Search is such an important part of any website. Use this article to really help your visitors.

Comments Off

Make 404 Pages much more helpful in WordPress

Miraz.

My Peachpit Web Design Reference Guide article about keeping lost visitors on your site has been published — Customizing WordPress 2.5.1: 404 Pages:

Friendly text and useful links in the 404.php file give your confused visitors a much more pleasant experience when visiting your site. They will stay, rather than go, and they may even come back again.

Make your blog just a bit friendlier. :-)

Comments Off

How to embed YouTube videos without invalid code

Miraz.

I’m developing a new blog and decided to check the validity of what I was doing. Once I recovered from the shock of 67 errors I realised that 2 embedded YouTube videos may well have been contributing problems. So I went searching and found this excellent advice:

If you’re looking to embed a YouTube video in your website’s code and want to retain your validity, … use the following

<object type=”application/x-shockwave-flash” style=”width:425px; height:350px;” data=”http://www.youtube.com/v/7_6B6vwE83U”><param name=”movie” value=”http://www.youtube.com/v/7_6B6vwE83U” /></object>

[Via : Embedding YouTube Videos as Valid XHTML 1.0, Bernie Zimmermann.]

Of course, you need to substitute the correct URL in two places.

In my new blog I fixed up a few other coding errors, used the above technique for the youTube videos and soon had the thrill of seeing the green ‘valid’ ribbon.

Mac OS X and the php.ini upload limit

Miraz.

Finding and fixing php.ini upload limits on Mac OS X.

Last night I was messing round exporting a WordPress blog and importing it into WordPress on my own Mac so I can play around with the design.

The MacTips blog I exported has almost 900 posts (ie 900 Tips). The downloaded file was 2.1Mb. That’s not particularly large, but it was enough to cause a problem when I tried to import it into the blog I’d set up on my Mac.

Maria Langer and I wrote in Chapter 10 of WordPress 2 Visual Quickstart Guide about exporting and importing between blogs.

When I came to import that 2.1Mb file I received an error message: The uploaded file exceeds the upload_max_filesize directive in php.ini. That upload limit is set at 2Mb, so I needed to change it.

It seemed obvious that the file php.ini was the one to edit, but where and how? Some Googling brought me to Enabling PHP and Apache in Leopard by David Powers.

First I had to create php.ini by copying another file, then it was a simple matter to locate the 2Mb limit and change it. I changed it to 8Mb.

David’s instructions are clear and easy to follow. You need a decent text editor such as TextWrangler (free) or BBEdit, and to paste in a few lines of code in the Terminal.

After amending the upload limit I went to the Sharing System Preference, turned Web Sharing off and then on again. That done, the import went smoothly. Now I can experiment with blog designs, with real content, but without disrupting the public blog.

Comments Off

WordPress vs Safari: Mars Edit to the rescue.

Miraz.

I’ve been using Mars Edit since it was part of NetNewsWire. It’s an excellent, stand-alone editor for blog posts, with all kinds of cool features. So I wasn’t aware of the problems Safari users are having with WordPress.

While I sometimes use the web editor for my WordPress blogs, especially when I need to include an image from my online photo albums (MacTips screenshots, personal photos), I’ll always use Mars Edit when I can.

What’s more, I seldom use Safari; OmniWeb is my main browser of choice, though I also use Flock quite often for browsing.

WordPress and the web editor

If you do decide to write WordPress posts in your web browser, the first thing to do is turn off the stupid Visual Rich Editor, or you’re likely to go postal. Maria and I wrote about how to do this in our book WordPress 2 Visual Quickstart Guide. Look at pages 26 and 27 to get started.

I also avoid using Flock for writing posts as it seems to just mess up what I write, whatever I do. OmniWeb works nicely though. But the best choice of all is separate software, such as Mars Edit or Ecto. Daniel Jalkut, author of Mars Edit, explains more of the web editor problem, in The Broken Web Editor:

Recently there has been an increase of new MarsEdit buyers who cite as their motivation a frustration with the WordPress web editor. I respect and admire the WordPress team. In fact, their web interface is among the best out there. But even in the best of circumstances, it’s hard to compete with the usability of a desktop app. And when something goes bad, it becomes downright impossible.

Currently the situation is especially bad for people who use WordPress with Safari. For whatever reason these two pieces of software have fallen slightly out of accord. It’s common to hear tale of people who use Safari for “everything but WordPress.” In short, WordPress has a reputation for messing up or even eliminating parts of your post when using the web-based editor in Safari. I know, because I see the comments of my customers and would-be customers on the web. There is a chorus of confirmation for this problem.

I look forward to WordPress and Safari to ironing out their differences.

[Via Red Sweater Blog: The Broken Web Editor.]

Ways to solve the web editor problem

So, if you’re working with WordPress, which is, after all, about the best blogging platform, here are some steps to take to make the experience even better:

  • if writing posts via the web interface, turn off the Visual Rich Editor, and use OmniWeb rather than Flock or Safari
  • use Mars Edit instead of the web interface
  • use some other stand-alone editor.
Comments Off

Quickly change multiple posts in WordPress

Miraz.

There are a few things that I find so useful and valuable I recommend them whenever I have the chance. Occasionally those services provide opportunities for an affiliate link, like ScreenCastsOnline. Because I may earn a few cents and would recommend them anyway, I take up the offer.

Then, once in a while, they change things around and I have to change the link I use. That happened today.

First I went to my blog’s theme and updated the sidebar. That took only a few seconds, but I also knew I’d mentioned the link in an unknown number of my 2177 posts to date. Changing those links was another matter entirely.

List of found posts in CocoaMySQL-SBG. Some people would go to PHPAdmin, in their web host’s Control Panel, but instead I started up a wonderful piece of free software called CocoaMySQL-SBG (for Macs). I’ve used this before so everything was all set up. I connected to my blog, selected the wp_posts table and clicked on the content tab. Then I selected post_content and contains from the pop-ups, entered a search term and clicked the search button. After a few moments 11 posts were identified as potential candidates for link changes.

Editing a post in CocoaMySQL-SBG. To change the links I then selected each post in turn and double-clicked on the post_content field. Then I could scan the text, make any necessary edits, and close. When I clicked on the next row the edit was written back to the database on the server.

It took only a few minutes to change all the relevant links. Of course, if I felt more confident about MySQL queries, I’m sure I could have written a query to do it. But this method worked well for me.

Interestingly enough, this process threw an error for one particular post, advising me that I needed to repair the database. I backed up the database, then clicked the Optimize Table button on the CocoaMySQL-SBG toolbar. That seemed to fix things.

For full details of how to set up CocoaMySQL-SBG see Chapter 10 of the WordPress 2 Visual Quickstart Guide that Maria Langer and I wrote last year. In short:

  1. Enable access to the database.
  2. Open CocoaMySQL-SBG. The New Connection sheet appears.
  3. Enter the same Host, User and Password details as you entered in the wp&#8209;config file when you installed your blog.

For Windows users — we explain in Chapter 10 how to work with a similar program, SQLyog for Windows.

Comments Off