Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2003
    Location
    Chicago
    Posts
    570

    * Word Press Theme PHP code error

    Hello,

    I am trying to install this new theme on my Wordpress based blog, and the functions.php files ends with this code, that is being flagged by my Dreamweaver as invalid code:

    PHP Code:
    <?php }





    add_action('wp_head''mytheme_wp_head');

    add_action('admin_menu''mytheme_add_admin');

    Any idea how to edit/add/delete/move tags or characters there to make it valid?

    Otherwise, when I try to open the http://mybloghere.com it says:

    Warning: Cannot modify header information - headers already sent by (output started at /home/usernamehere/public_html/wp-content/themes/themename/functions.php:9)

    Any suggestions would be appreciated. The coder must have left out something?
    Let's talk custom servers and reseller plans

  2. #2
    Join Date
    Nov 2004
    Posts
    258
    Well that error means data was sent to the browser so you cant run whatever function is trying to run like sessions or anything else that requires to run first before anything else. For testing purposes you could be ob_start() at the top of this script and re-run it.

    Silly

  3. #3
    Join Date
    Dec 2007
    Location
    Lebanon
    Posts
    413
    try moving this code "add_action('wp_head', 'mytheme_wp_head');" to the top of the page

  4. #4
    Join Date
    Nov 2003
    Location
    Chicago
    Posts
    570
    I tried both things and none worked. I wanted to say: I do not remember what exactly I edited, but it was in the area of the quoted php code that I added something that fixed everything, so I repeat: this is a code error.

    I am sorry I do not remember what I did and pasted the same file over the modified one
    Let's talk custom servers and reseller plans

  5. #5
    Join Date
    Nov 2004
    Posts
    258
    Depends on your definition of a code error. Data is being outputted to the browser before some code that shouldnt. It could be that script or something in the include scripts. For example if you echo text out before a header command you will get that error.

    Silly

  6. #6
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,842
    If that's really the end of the file then you're missing the closing php tag:
    Code:
    <?php }
    }
    add_action('wp_head', 'mytheme_wp_head');
    add_action('admin_menu', 'mytheme_add_admin'); 
    ?>
    Edit: also make sure you don't have blank lines after that closing tag.
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

  7. #7
    Join Date
    Nov 2003
    Location
    Chicago
    Posts
    570
    Thank you all. I finally got the latest version of the file from the creator. It does end the same, but seems not to create errors in the output anymore. Thank you all for your support and alertness.
    Let's talk custom servers and reseller plans

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •