• PHP Help PHP Newbies
  • [RESOLVED] Parse error: syntax error, unexpected '.' in /home2/zockedi/public_html/blogbods.com/

I am begging for help about a query that has been posted here by others many times before - but each case is slightly different. I therefore need to post my own.

I have a Genesis WordPress site with the EPIK theme and I installed Woocommerce and found that the related product images were blurry. Went to a forum where loads of people had the same issue and a chap provided a code to add to the function CSS of your child theme - and it worked for many other people...

Naturally, it didn't work for me! And naturally I didn't have the sense to back up my file first. I know. I'm an idiot.

Now, when I try to access my homepage I get: Parse error: syntax error, unexpected '.' in /home2/zockedi/public_html/blogbods.com/wp-content/themes/epik/functions.php on line 229

The weird thing is I removed the code I'd added....yet the error message remains! Please help. In my next post I'll put the code as there is no room here.

    <?php
    //* Start the engine
    require_once( get_template_directory() . '/lib/init.php' );

    //* Child theme (do not remove)
    define( 'CHILD_THEME_NAME', 'Epik Theme', 'epik' );
    define( 'CHILD_THEME_URL', 'http://my.studiopress.com/themes/epik/' );

    //* Enqueue Lato Google font
    add_action( 'wp_enqueue_scripts', 'genesis_sample_google_fonts' );
    function genesis_sample_google_fonts() {
    wp_enqueue_style( 'google-font', '//fonts.googleapis.com/css?family=Open+Sans:300,400,700', array(), PARENT_THEME_VERSION );
    }

    //* Add HTML5 markup structure
    add_theme_support( 'html5' );

    //* Add viewport meta tag for mobile browsers
    add_theme_support( 'genesis-responsive-viewport' );

    //* Add support for custom background
    add_theme_support( 'custom-background' );

    // Create additional color style options
    add_theme_support( 'genesis-style-selector', array(
    'epik-black' => ( 'Black', 'epik' ),
    'epik-blue' =>
    ( 'Blue', 'epik' ),
    'epik-darkblue' => ( 'Dark Blue', 'epik' ),
    'epik-gray' =>
    ( 'Gray', 'epik' ),
    'epik-green' => ( 'Green', 'epik' ),
    'epik-orange' =>
    ( 'Orange', 'epik' ),
    'epik-pink' => ( 'Pink', 'epik' ),
    'epik-purple' =>
    ( 'Purple', 'epik' ),
    'epik-red' => __( 'Red', 'epik' ),
    ) );

    // Add support for custom header
    add_theme_support( 'genesis-custom-header', array(
    'width' => 360,
    'height' => 164
    ) );

    // Add new image sizes
    add_image_size( 'featured-img', 730, 420, TRUE );
    add_image_size( 'featured-page', 341, 173, TRUE );
    add_image_size( 'portfolio-thumbnail', 264, 200, TRUE );

    // Add support for structural wraps
    add_theme_support( 'genesis-structural-wraps', array( 'header', 'nav', 'subnav', 'inner', 'footer-widgets', 'footer' ) );

    // Reposition the Secondary Navigation
    remove_action( 'genesis_after_header', 'genesis_do_subnav' ) ;
    add_action( 'genesis_before_header', 'genesis_do_subnav' );

    // Before Header Wrap
    add_action( 'genesis_before_header', 'before_header_wrap' );
    function before_header_wrap() {
    echo '<div class="head-wrap">';
    }

    // Reposition the Primary Navigation
    remove_action( 'genesis_after_header', 'genesis_do_nav' ) ;
    add_action( 'genesis_after_header', 'genesis_do_nav' );

    // After Header Wrap
    add_action( 'genesis_after_header', 'after_header_wrap' );
    function after_header_wrap() {
    echo '</div>';
    }

    // Customize search form input box text
    add_filter( 'genesis_search_text', 'custom_search_text' );
    function custom_search_text($text) {
    return esc_attr( 'Search...' );
    }

    add_action( 'admin_menu', 'epik_theme_settings_init', 15 );
    /**
    This is a necessary go-between to get our scripts and boxes loaded
    on the theme settings page only, and not the rest of the admin
    */
    function epik_theme_settings_init() {
    global $_genesis_admin_settings;

    add_action( 'load-' . $_genesis_admin_settings->pagehook, 'epik_add_portfolio_settings_box', 20 ); 

    }

    // Add Portfolio Settings box to Genesis Theme Settings
    function epik_add_portfolio_settings_box() {
    global $_genesis_admin_settings;

    add_meta_box( 'genesis-theme-settings-epik-portfolio', __( 'Portfolio Page Settings', 'epik' ), 'epik_theme_settings_portfolio',     $_genesis_admin_settings->pagehook, 'main' ); 

    }

    /**
    Adds Portfolio Options to Genesis Theme Settings Page
    /

      Please, please can somebody help me with my query? I tried to post about it a while ago, but wasn't able to fit all the info in or edit my thread. THIS thread I think makes sense. (I am trying to work out how to delete the old thread- sorry.)

      I have a Genesis WordPress site with the EPIK theme and I installed Woocommerce and found that the related product images were blurry. Went to a forum where loads of people had the same issue and a chap provided a code to add to the function CSS of your child theme - and it worked for many other people...

      Naturally, it didn't work for me! And naturally I didn't have the sense to back up my file first. I know. I'm an idiot.

      Now, when I try to access my homepage I get: Parse error: syntax error, unexpected '.' in /home2/zockedi/public_html/blogbods.com/wp-content/themes/epik/functions.php on line 229

      This is hopeless. All my code won't fit in these boxes. I used pastebin - it shows you the number for each line of code. The line with the error is apparently 229. The code ends at 228. So confusing. Here is line 228 if it helps:

      Here are lines 227 and 228:

      ) );
      add_theme_support( 'genesis-connect-woocommerce' );

      There is no line 229 as the code ended there. There WAS a line 229 - here is the code I added after it - and then removed. Presumably the first line is line 229. Here it is:

      .woocommerce div.product div.images,.woocommerce-page div.product div.images,.woocommerce #content div.product div.images,.woocommerce-page #content div.product div.images{width:auto;}

      .woocommerce .related ul.products li.product img,.woocommerce-page .related ul.products li.product img,.woocommerce .upsells.products ul.products li.product img,.woocommerce-page .upsells.products ul.products li.product img,.woocommerce .related ul li.product img,.woocommerce-page .related ul li.product img,.woocommerce .upsells.products ul li.product img,.woocommerce-page .upsells.products ul li.product img{width:auto;height:auto;margin-right:10px;}

      .woocommerce ul.products li.product,.woocommerce-page ul.products li.product{width:auto;}

      Please, please help.

        Probably not quite enough there for us to be sure. Based on what I'm seeing here, it looks like it's a PHP file that outputs CSS, and you have some non-PHP text in there for some of the CSS. I'm guessing maybe you need a closing ?> tag to get out of PHP mode before you get to that CSS text?

        <?php
        // some PHP code here, ending with:
        add_theme_support( 'genesis-connect-woocommerce' );
        // at which point we need to get out of PHP mode:
        ?>
        
        .woocommerce div.product div.images,.woocommerce-page div.product div.images,.woocommerce #content div.product div.images,.woocommerce-page #content div.product div.images{width:auto;}
        
        .woocommerce .related ul.products li.product img,.woocommerce-page .related ul.products li.product img,.woocommerce .upsells.products ul.products li.product img,.woocommerce-page .upsells.products ul.products li.product img,.woocommerce .related ul li.product img,.woocommerce-page .related ul li.product img,.woocommerce .upsells.products ul li.product img,.woocommerce-page .upsells.products ul li.product img{width:auto;height:auto;margin-right:10px;}
        
        .woocommerce ul.products li.product,.woocommerce-page ul.products li.product{width:auto;}
        
          Write a Reply...