Styling WordPress Search Forms with Bootstrap Icons

Bootstrap Icons Image

I’m still in the process of scratch-building a responsive WordPress theme with Bootstrap and today decided to tackle the search widget styling. Well, to be completely honest I’m not quite scratch-building it — I’m adapting Automattic’s Toolbox theme, but I’m hand-rolling most of the responsive features.

If you’re not using Bootstrap, the process of styling the search widget is pretty straightforward — just modify (or define) the relevant CSS classes and you’re good to go. In order to use Bootstrap icons, however, it helps to restructure the the form input element. Since Bootstraps’ icons (from Glyphicons) are all stored in single sprite you can’t link directly to an individual icon in order to set it as a CSS element’s background property. Instead you specify the icon by CSS class name, which positions the element’s viewport over the selected part of the sprite.

Continue reading

Testing a Bootstrap Installation on WordPress

bootstrap

The Bootstrap front-end framework is pretty cool and extremely easy to use, but it’s not always obvious that everything is working properly after installation. You’ll see the new style sheets right away, but testing the Javascript takes a little bit of extra effort.

Here’s an overview of the process:

  1. Download and install the Bootstrap framework
  2. Modify functions.php and header.php to load and Javascript and stylesheets
  3. Test Javascript with a Bootstrap-specific feature

Continue reading

Using Gmail SMTP with PHP Swift Mailer

Swift Mailer Image

Skip the background and jump to the code snippets

I was recently asked to provide a solution for a client whose site host was shutting down their email servers and needed a new webmail provider. The hosting company was throwing all of the business to Rackspace for $2.00 per email address per month with a five-address minimum. Ten dollars a month isn’t bad (I like Rackspace — I’m a satisfied customer), but the client was only using one address. Gmail, on the other hand, is no longer free for businesses, but at about $50.00 per year per address it was a better deal for my client. Not to mention the other advantages that come with it, including virus/malware protection and smartphone app ubiquity.

Continue reading