Parse/Syntax error in PHP file has brought my site down

Go To


I am working on my PHP file and now I get this message.

"Parse error: syntax error, unexpected '<', expecting T_FUNCTION in /home/content/18/9029618/html/wp-content/themes/NewBusiness/includes/aboutus.php on line 8"

Have no idea what is wrong and now my site is down. Here is the code below.


new Themater_AboutUs();

class Themater_AboutUs
    var $theme;

    var $defaults = array(
        'enabled' => 'true',
        'hook' => 'main_before',
        'title' => 'Welcome to our website. Neque porro quisquam est qui dolorem ipsum dolor.',
        'image' => 'about-image.jpg',
        'content' => 'Lorem ipsum eu usu assum liberavisse, ut munere praesent complectitur mea. Sit an option maiorum principes. Ne per probo magna idque, est veniam exerci appareat no. Sit at amet propriae intellegebat, natum iusto forensibus duo ut. Pro hinc aperiri fabulas ut, probo tractatos euripidis an vis, ignota oblique. <br /> <br />Ad ius munere soluta deterruisset, quot veri id vim, te vel bonorum ornatus persequeris. Maecenas ornare tortor. Donec sed tellus eget sapien fringilla nonummy. Mauris a ante. Suspendisse quam sem, consequat at, commodo vitae, feugiat in, nunc. Morbi imperdiet augue quis tellus.'

    function Themater_AboutUs()
        global $theme;
        $this->theme = $theme;

        if(is_array($this->theme->options['plugins_options']['aboutus']) ) {
            $this->defaults = array_merge($this->defaults, $this->theme->options['plugins_options']['aboutus']);

        if($this->theme->display('aboutus_enabled') ) { 
            $this->theme->add_hook($this->defaults['hook'], array(&$this, 'display_aboutus'));

        if($this->theme->is_admin_user()) {

    function display_aboutus()
        if(is_home()) {
            ?><div class="span-24 aboutusbox">


            if($this->theme->display('aboutus_image')) {
                echo '<img class="aboutusbox-image" src="' . $this->theme->get_option('aboutus_image') . '" />';

            if($this->theme->display('aboutus_title')) {
                echo '<h2 class="aboutusbox-title">' . $this->theme->get_option('aboutus_title') . '</h2>';

            if($this->theme->display('aboutus_content')) {
                echo '<div class="aboutusbox-content">' . $this->theme->get_option('aboutus_content') . '</div>';

    function aboutus_options()
        $this->theme->admin_option(array('About Us', 14), 
            '"About Us" section enabled?', 'aboutus_enabled', 
            'checkbox', $this->defaults['enabled'], 

        $this->theme->admin_option('About Us', 
            'Title', 'aboutus_title', 
            'text', $this->defaults['title']

        $this->theme->admin_option('About Us', 
            'Image', 'aboutus_image', 
            'imageupload', get_bloginfo('template_directory') . "/images/" . $this->defaults['image'], 
            array('help' => "Enter the full url. Leave it blank if you don't want to use an image.")

        $this->theme->admin_option('About Us', 
            'Content', 'aboutus_content', 
            'textarea', $this->defaults['content'],
            array('style'=>'height: 250px;')
2012-04-04 05:01
by Alex


Is that the full file? Is there a <?php at the beginning?

The sample that you have pasted is missing a closing brace } at the end.

2012-04-04 05:03
by A B
Yes there is that at the beginning. I was unsure how to post the full code so only posted half because it says line 8. Should I post the full - Alex 2012-04-04 05:05
Would be helpful to have the full code, yes. Also, what version of PHP - A B 2012-04-04 05:09
@Alex: Probably. What's here, being incomplete, doesn't seem to have the issue that'd cause the error you're seeing - cHao 2012-04-04 05:09
I will post to a new question because it won't let me post the full code here. Thanks! Keep a lookout - Alex 2012-04-04 05:10
@Alex: Don't post the code in a comment or post a new question. Edit this question to add it. (You should see an "edit" link under your question. - cHao 2012-04-04 05:11
Thanks, there we go. Any ideas - Alex 2012-04-04 05:17
@alberge Not sure what version. It is in Wordpress 3.3. - Alex 2012-04-04 05:19