Tag: fix

  • WordPress + CDATA nightmare

    Do you know what is worse than not knowing the solution or even the reason to a problem?

    Well, that must be, knowing that you have experienced the same problem in the past and resolved it, but no matter how much you try, you can not remember at all what the problem was due and what you did to fix it.

    So this evening several hours went by due to a silly and stupid WordPress issue I already fixed once in the past but lost during an upgrade. This time I wanted to make sure I got the solution written down as I would probably forget it again.

    On my Marbella news site I was working on embedding an external flash video inside an iframe, which itself was invoked via Javascript to avoid the W3 Validator complaining about XHTML 1.1 and iframes being taboo.

    Basically it was WordPress’ over-zealous filters that caught a greater-than sign (>) and converted it to the equivalent HTML entity (>). The most annoying thing is that I already have the Raw HTML plugin installed which disables WordPress’ text filtering. And it also worked fine for the rest of the Javascript and HTML tags in the page text. It was just on one single character, namely in the CDATA closing tag with // ]]> converted to // ]]>.

    After searching many different combinations I finally hit it on the nail. I was not alone either.

    The annoying culprit is this little line in /wp-includes/post-template.php, which I once more commented out:

    $content = str_replace(']]>', ']]>', $content);

    For some reason the WordPress developers have not yet fixed this issue after 3 years of it being reported.

    As a big fan of open source I appreciate the time and money spent by volunteers in many similar projects, however this is not the first time I see quick to fix issues hanging around for ages, simply due to people preferring to have an academic discussion on who can provide the most elegant solution, instead of simply fixing the issue first and talk later.

    Sometimes I wonder how projects ever become real projects.

    Anyhow there was a happy ending as you can see for yourself.

  • Remove white border on images in WP

    When posting last time I realised my example images had a little white border around them. For other occasions it may have been nice but this time I needed it without any borders.

    Another example below, left with white border and right with no border:

    test image test image

    To remove that automatically added border when you submit your post using WordPress do the following:

    1. Open your post for editing.
    2. Click on the image in question and select the Edit Image option.
    3. Click on the Advanced Settings tab on the top.
    4. Insert a 0 (zero digit) in the Border field under Image Properties.
    5. Save.

    Pretty simple stuff but thought I would share it in case someone else was looking for a remedy.

  • Find a Windows Vista MAC Address

    Yesterday eve I had to add a laptop to my network which is using MAC address filtering. The laptop ran Windows Vista and I tried to locate its MAC address by using the good old ipconfig within a command prompt. This gave no results as apparently the network details only get listed once an actual network connection is made. As you probably have realised this is a catch-22 situation as without the MAC address registered on the router I was never going to make a network connection in the first place…!

    Actually the weird thing is that the MAC address is normally on a sticker on the bottom of laptops, but in this case there was no such sticker.

    Google as in most other cases provided a quick fix by pointing me in the right direction. There is a command specifically for this task named funnily enough: getmac.