Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Parse Error / Syntax error

    Hi all!

    I am doing some custom page templates in Wordpress and came across a syntax error that I can't seem to find.

    Here is the error: Parse error: syntax error, unexpected $end in /home/xxx/public_html/xxx/wp-content/themes/xxx/home.php on line 58

    home.php:

    PHP Code:
    <?php

    add_action
    'genesis_meta''campaign_home_genesis_meta' );
    /**
     * Add widget support for homepage. If no widgets active, display the default loop.
     *
     */
    function campaign_home_genesis_meta() {

        if ( 
    is_active_sidebar'twitter' ) || is_active_sidebar'issues' ) || is_active_sidebar'action' ) || is_active_sidebar'press' ) || is_active_sidebar'social-network' ) || is_active_sidebar'esign-up' ) ) {

            
    remove_action'genesis_loop''genesis_do_loop' );
            
    add_action'genesis_loop''campaign_home_loop_helper' );
            
    add_filter'genesis_pre_get_option_site_layout''__genesis_return_full_width_content' );

        }
    }

    function 
    campaign_home_loop_helper() {

        if ( 
    is_active_sidebar'twitter' ) ) {
            echo 
    '<div id="twitter"><div class="wrap">';
            
    dynamic_sidebar'twitter' );
            echo 
    '</div><!-- end .wrap --></div><!-- end .twitter -->';
        }

        if ( 
    is_active_sidebar'issues' ) ) {
            echo 
    '<div id="issues"><div class="wrap">';
            
    dynamic_sidebar'issues' );
            echo 
    '</div><!-- end .wrap --></div><!-- end .issues -->';
        }

        if ( 
    is_active_sidebar'action' ) ) {
            echo 
    '<div id="action"><div class="wrap">';
            
    dynamic_sidebar'action' );
            echo 
    '</div><!-- end .wrap --></div><!-- end .action -->';
        }

        if ( 
    is_active_sidebar'press' ) ) {
            echo 
    '<div id="press"><div class="wrap">';
            
    dynamic_sidebar'press' );
            echo 
    '</div><!-- end .wrap --></div><!-- end .press -->';
        }

    [
    B]/** ADDED THESE 2 ACTIVE SIDEBARS AND THAT IS WHAT THREW THE ERROR **/[/B]
        
        if ( 
    is_active_sidebar'social-network' ) ) {
            echo 
    '<body class="social">';
            
    dynamic_sidebar'social-network' );
            echo 
    '</div><!-- end .social -->';

        if ( 
    is_active_sidebar'esign-up' ) ) {
            echo 
    '<body class="signup">';
            
    dynamic_sidebar'esign-up' );
            echo 
    '</div><!-- end .signup -->';
        }

    }

    genesis();
    From what I understand, a curly bracket could be missing (i'm not sure where though) or it doesn't like my body class= tags.

    Any help I could get in solving this error would be so much appreciated! I have fixed everything I knew how to fix .... but just can't seem to find this one.
    Last edited by kjetterman; 09-14-2012 at 03:43 PM.

  • #2
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Nevermind! I figured this one out!! I was missing a curly bracket after my first registered sidebar code block (of the two that I added). Doh!!

  • #3
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,345
    Thanks
    60
    Thanked 527 Times in 514 Posts
    Blog Entries
    4
    If you look in my signature, I have a link about this very issue which shows you how to identify this problem and fix it in the future.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!


  •  

    Posting Permissions

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