WordPress Import ends up with a blank screen

If you’re having trouble importing posts using WordPress’ built-in importer, and always end up with a blank screen instead of a success notice even after editing the php.ini settings, chances are you don’t have the PHP-XML module installed yet. I pinpointed the problem after viewing the PHP error log which should, by default, be located [...]


MIME types on CentOS Apache Server

It so happened my browser wasn’t handling CSS files the way it should on a recent WordPress installation inside a CentOS machine. The browser opts to download files ending with .css instead of parsing content and outputting it to the browser. Basically, if the file (or more specifically, it’s extension, which in this case is [...]


Manually adding errors to CI’s validation_errors function

If you’ve been working with CodeIgniter’s native Form_validation class, you’ll notice that the class has limited functionality when it comes to setting up custom errors, especially with array values. This tutorial lets you create a custom method to set validation errors manually by extending the form validation class. However, the snippet in the tutorial only [...]


Convert newline characters into paragraph tags

While I’m thankful for the built in nl2br tag used by WordPress, I still want chunks of text to be enclosed in paragraph tags (similar to WP’s autop function). I decided to write my own function to increase my fluency in using regular expressions. function nl2p($text="") {   $rgx = '|\s(?=\s)|';   $text = preg_replace($rgx, "", $text); [...]


WordPress: center images without turning them into blocks

If you’re familiar with WordPress theme development (and even just basic CSS), you probably already know that there’s no way to center align an image without turning it into a block. Even if you use the text-align: center declaration on the image element itself, it won’t work either. The problem with blocks is that they [...]


Forcing the www subdomain with CodeIgniter

Though some might say that the www subdomain is already losing its popularity, a lot of web developers are still implementing it. It has no tremendous impact on SEO, though, so your website won’t be penalized in any way on Google search rankings. A lot of companies I’ve asked prefer to have the www appended because [...]

← View Older Posts