• schrade

    (@schrade)


    I’m posting this here, becauseI assume someone working with plugins has already seen this behavior.

    I created a customization plugin, to keep most of my changes to wp out of the upgrade loop. Things like adding behavioral JS code etc. So i have the following plug in code which activates and works fine on one machine with the latest IE 6+ browser and patches. Go to another machine and I get an empty page (no WP content at all — just html/head/body tags). Disable the plugin, and all browser versions display fine. Ugh.

    I promise ahead of time, there are no empty spaces before the PHP tags or trailing the PHP tags before the EOF.

    The entire plug in looks like this at the moment…


    <?php
    /*
    Plugin Name: Customizations
    Plugin URI: http://www.example.com/wp-custom-example
    Description: Provides hooks for some of the customizations of WordPress 1.5 on Example.com
    Author: Me
    Version: 1.0
    Author URI: http://www.Example.com
    */
    ?>

    <?php
    function example_wp_head($unused)
    {
    // Add the generic utility functions JS file
    echo '<script language="javascript" src="/js/utils.js"></script>';
    echo "n";

    // Add javascript behavior here
    echo '<script language="javascript" src="/js/behaviors.js"></script>';
    echo "n";
    }
    add_action('wp_head', 'example_wp_head');

    ?>

Viewing 4 replies - 1 through 4 (of 4 total)
  • Kafkaesqui

    (@kafkaesqui)

    1. There’s no reason to break up your plugin into two php elements (and it causes header errors when I activate it):

    */
    ?>

    <?php
    function example_wp_head($unused)
    {

    should be:

    */

    function example_wp_head($unused)
    {

    2. After making the above change, it runs fine here.

    Thread Starter schrade

    (@schrade)

    Thank you… I never thought something so simple would be an issue… I will try it, thanks for your time.

    davidchait

    (@davidchait)

    it’s because the blank line actually OUTPUTS a blank into the html, starting the body content. Maybe IE doesn’t like it, and Firefox gets around it — both should barf on it. 😉

    -d

    Kafkaesqui

    (@kafkaesqui)

    Barf. It’s my favorite coding term.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Q: Plugin activation causing IE browsers to display blank page?’ is closed to new replies.