ThemeShaper Forums » Thematic

[closed]

Error when i go to the admin page

(6 posts)
  • Started 11 years ago by pm
  • Latest reply from pm
  • This topic is not resolved
  1. pm
    Member

    Hello all,

    I'm sorry my english isn't very well. My website project is located here : http://rhq.free.fr/wordpress

    My website uses a child theme (style.css + functions.php only)

    When i try to log in, i get two errors and can't access my dashboard (Blank page and errors) : Warning: Cannot modify header information - headers already sent by (output started at /mnt/165/sda/2/2/rhq/wordpress/wp-content/themes/theveils/functions.php:33) in /mnt/165/sda/2/2/rhq/wordpress/wp-login.php on line 302

    The line 33 of my functions file is : <script type="text/javascript">

    Here is my functions file :

    <?php

    function remove_header(){
    remove_action('thematic_header','thematic_brandingopen',1);
    remove_action('thematic_header','thematic_blogtitle',3);
    remove_action('thematic_header','thematic_blogdescription',5);
    remove_action('thematic_header','thematic_brandingclose',7);
    remove_action('thematic_header','thematic_access',9);

    ?>
    <script type="text/javascript">
    var so = new SWFObject("background.swf", "flashObject", "100%", "100%", "1", "#ffffff");
    so.addParam("wmode", "opaque");
    so.write("flash_bg");
    </script>
    <?php
    }
    add_action('init', 'remove_header');

    function add_something_cool(){?>
    <div id="flash_bg">
    <object type="application/x-shockwave-flash" data="background.swf" width="100%" height="100%">
    <param name="movie" value="background.swf" />
    <param name="bgcolor" value="#000000" />
    </object>
    </div>
    <?php
    }
    add_action('thematic_after','add_something_cool');

    ?>

    Posted 11 years ago #
  2. Hi,

    seems as if there are blanks, CR/LFs after the last closing ?>.

    In addition I would wrap the script into a separate function and add this action to wp-head instead of init. Currently your script is located before the doctype declaration :)

    Chris

    Posted 11 years ago #
  3. Just remove the last closing ?>.

    Posted 11 years ago #
  4. pm
    Member

    It fixed the errors but the flash background doesn't work anymore :(

    What's the difference between 'init' and 'wp_head' ?

    Here is my "corrected" functions file :

    <?php

    function remove_header(){
    remove_action('thematic_header','thematic_brandingopen',1);
    remove_action('thematic_header','thematic_blogtitle',3);
    remove_action('thematic_header','thematic_blogdescription',5);
    remove_action('thematic_header','thematic_brandingclose',7);
    remove_action('thematic_header','thematic_access',9);
    }
    add_action('init', 'remove_header');

    function ma_fonction(){?>
    <script type="text/javascript">
    var so = new SWFObject("background.swf", "flashObject", "100%", "100%", "8", "#ffffff");
    so.addParam("wmode", "opaque");
    so.write("flash_bg");
    </script>
    <?php
    }
    add_action('wp_head', 'ma_fonction');

    function add_something_cool(){?>
    <div id="flash_bg">
    <object type="application/x-shockwave-flash" data="background.swf" width="100%" height="100%">
    <param name="movie" value="background.swf" />
    <param name="bgcolor" value="#000000" />
    </object>
    </div>
    <?php
    }
    add_action('thematic_after','add_something_cool');

    ?>

    Posted 11 years ago #
  5. Thake a look at the Action Reference: http://codex.wordpress.org/Plugin_API/Action_Reference

    Did it work before you moved the script from 'init' to 'wp_head'?

    Posted 11 years ago #
  6. pm
    Member

    It fixed the error messages but my flash (swf) background disappeared.

    Posted 11 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.