Featured Content Gallery plugin misbehaving against WordPress 2.8 installation

Last week I was working on a WordPress Website that will display recent news on its Homepage. I searched for a nice, simple WP plugin that would display featured posts as sliding photos with a title and description of the post. After searching extensively for the right fit I came across Featured Content Gallery. I gotta say I love this plugin. It creates an automated rotating image gallery of your posts. It’s simple, nice, elegant.

The problem: After downloading, installing and configuring the plugin, instead of the automated rotating image it would simply display a blank rectangle.

So I went to the plugin’s forum and found a post under Development, Improvement, and Conflicts called wp 2.8 There are several users that posted their solution, I posted mine too. Let me explain what worked for me.

My Web server profile

  • Linux Red Hat
  • Apache 2.2.3
  • PHP 5.2.0
  • WordPress 2.8

In my opinion, this is the problem
The jd.gallery.js.php file from FCG uses short tags. You can find this file under the Featured Content Gallery folder. If your php.ini has the value of short_open_tag set to Off, the Featured Content Gallery plugin won’t work. The short_open_tag directive tells PHP whether the short form (<? ?>) of PHP’s open tags should be allowed. If disabled, you must use the long form of the PHP open tag (<?php ?>).

The php.ini file states:

“It’s been recommended for several years that you not use the short tag “short cut” and instead to use the full tag combination. With the wide spread use of XML and use of these tags by other languages, the server can become easily confused and end up parsing the wrong code in the wrong context. But because this short cut has been a feature for such a long time, it’s currently still supported for backwards compatibility, but we recommend you don’t use them.”

The solution
Opened jd.gallery.js.php and edited the 4 or 5 lines that contain short tags.
For example, I replaced

&lt;?=$fcg_button ?&gt;

for

&lt;?php echo $fcg_button; ?&gt;

If you don’t want to do that, you could also set short_open_tag directive from Off to On. Just remember this is not recommended because “the server can become easily confused and end up parsing the wrong code in the wrong context”.

Leave a Reply