Frank’s Weblog

Old enough to know better, young enough to not care

WordPress replacing HTML tags, a workaround

With some of my posts I really need to struggle to get it to look just they way I want it to look. More often then not this is caused by the engine behind WordPress removing certain pieces of information from HTML tags.

I have put together the following list providing the types of tags that were giving me headaches and the solutions I have been able to find for them.

Hopefully other can benefit from my findings.

Using BR-tags

Most of the time when I add images to one of my blog posts I want the image to align either to the left or the right. I do this by adding a style attribute, like so

<img src="whatever.jpg" style="float: left"/>

If I want to make sure the image does not overlaps the end of the post or moves into the paragraph following the image I would insert the following

<br style="clear: both" />

However as soon as you save the post the above BR-tag gets replaced with a regular BR-tag and breaks the layout of the post.

Instead of insert the BR-tag you can insert the following piece of HTML code, which produces the same result, but does not get replaced or removed by WordPress.

<div style="clear: both;"><!-- --></div>

Using TH-tags

When doing formatting on tables within your post it is good to know that any formatting that you apply to the TH-tag gets completely removed when saving the post.

So instead of using TH-tag

<th style="text-align: left"> .... </th>

Just use a regular TD-tag to build your table headings and apply the wanted format to those elements, like so

<td style="text-align: left; font-weight: bold;"> .... </td>

After playing around with different themes it seems not only to be related to WordPress, but also the theme that you are using. Just so you know. When you change from one theme to the other, you might want to revisit some of your earlier posts to see if things are still looking correct.

July 23, 2008 Posted by fmeus | HTML, WordPress | | No Comments Yet

Add news feeds to NewsGator from Firefox the easy way

When I am working on my Mac it is easy to add new news feeds to NewsGator since I have NewNewsWire installed, but when I am not working on my Mac, for instance when I am at my work doing some research I would still be able to add news feeds I come across to my NewsGator account.

I know that NewsGator provides toolbars for both Internet Explorer and Firefox, but I do not like to install additional pieces of software just to add a news feed. Also when I am working at clients using their hardware mist of the time you will not be able to install software anyway.

Default servicesFirefox itself has support for adding news feed to some online services (Bloglines, My Yahoo and Google) as well as Firefox’s own bookmarking system (local to the browser itself).

Play nice with meAlthough Firefox by default has only three services defined, there is room for a total of six services (0 through 5). The settings for these services can be found within the ‘about:config’-page of Firefox. Staring from version 3 of Firefox when you try to open the ‘about:config’-page, Firefox warns you about the damage you could do to Firefox by changing settings using this page. So you have to confirm that you will play nice with Firefox by clicking on the button “I’ll be careful, I promise!”.

Filter settingsOn the ‘about:config’-page type the string ‘browser.contentHandlers’ into the Filter-field, this will make sure only the relevant settings are displayed.

The settings for a unused entry (most likely this will be the one numbered 3) are

Preference Name Status Type Value
browser.contentHandlers.types.3.title default string chrome://browser-region/locale/region.properties
browser.contentHandlers.types.3.type default string application/vnd.mozilla.maybe.feed
browser.contentHandlers.types.3.uri default string chrome://browser-region/locale/region.properties

To add NewsGator as a content handler for news feeds we will change the settings for the first available unused entry

Preference Name Status Type Value
browser.contentHandlers.types.3.title user set string NewsGator
browser.contentHandlers.types.3.type default string application/vnd.mozilla.maybe.feed
browser.contentHandlers.types.3.uri user set string http://www.newsgator.com/ngs/subscriber/subext.aspx?url=%s

New service availableNow it is time to restart Firefox to let these changes take effect.

From now on every time you click on a RSS feed, Firefox will give you the possibility to add the news feed to your NewsGator account.

July 23, 2008 Posted by fmeus | Firefox, Network, Technology | | No Comments Yet

Keeping my digital life in-sync

In the wake of my new iPhone I am working on making the efforts needed to keep information synced between the several devices I am using easier. Currently I am using at least 4 devices, being;

  • an iPod, soon to be replaced with an iPhone depending on the speed of both Apple and T-Mobile
  • an iMac
  • a MacBook Pro
  • a regular laptop running the Windows OS for work

The information I am currently most concerned about keeping in sync are;

  • Contact information
  • Calendar information
  • Bookmarks
  • News feeds

Contact and Calendar information
This one I have solved by buying myself a MobileMe subscription from Apple. Despite all of the negative responses revolving around the Push not being a real push and numerous outages around the world, I find myself among the lucky ones. So far I have no real issues when using MobileMe. I had however some issues with the iPod Touch initially, it would sync over the complete calendar down to the iPod regardless of what settings I was using. After some fiddling with the settings I found what was working for me

  • Set the iPod Touch up for manually syncing
    • Turn ‘Fetch New Data’ to off
    • Fetch mode to ‘Manually’
  • Open the Calendar application and wait for it to (first clear and then) receive all of your data
  • Set the iPod Touch up for Push
    • Turn ‘Fetch New Data’ to On
    • Fetch mode to ‘Every 15 minutes’

Bookmarks
Since I mainly use Firefox for my internet browsing, keeping my bookmarks in-sync could be easily achieved by using the brilliant addon named Foxmarks (see also one of my earlier posts). The only downside is that Firefox is not running on the iPod Touch or iPhone. This means that I don’t have direct access to my bookmarks when I am on the road. I could be using Foxmarks website to access my bookmarks, but I would much rather have a way of syncing my Firefox bookmarks into Safari.

This is something I still need to figure out.

News feeds
For getting the latest news from several web sites around the world I have been using NewsFire on my Mac OS X based machines. This has always worked fine for me, but since the introduction of the new software version for both the iPod Touch and iPhone combined with the introduction of the iTunes App Store a whole new world of abilities has been opened for these two devices (unless you had jail broken your device, then you had access to third-party apps for quite some time already).

On the iTunes App Store I found the application NetNewsWire (the link will take you to the iTunes App Store), which is a RSS news feed reader. I already knew this application as a regular Mac OS X application, but I had never really looked at it since I liked NewsFire and was not looking for a replacement for it.
With the possibility of running NetNewsWire on the iPod Touch this has totally changed. So yesterday NetNewsWire has replaced NewsFire on both my Macs and has been installed on my iPod Touch.
The synching of the RSS feeds is handled by using the services of NewsGator. Just sign up for a free account and your are pretty much set.

NewsGator also provides toolbar applications for both Internet Explorer and Firefox, but since these are provided as a downloadable executable, these are unusable on a Mac. I have found another way which allows you to add news feeds to your NewsGator account without the need of an addon or applications. I will describe this in a separate post.

July 23, 2008 Posted by fmeus | Apple, Firefox, Mac, Network, Software, Technology, iPhone | | 1 Comment