• Resolved heyyitzpat

    (@heyyitzpat)


    I’m having this issue with a theme I uploaded. It is in the themeOptions/functions.php file.

    Here’s the default file:

    <?php
    if ( !function_exists( 'optionsframework_init' ) ) {
    /*-----------------------------------------------------------------------------------*/
    /* Options Framework Theme
    /*-----------------------------------------------------------------------------------*/
    /* Set the file path based on whether the Options Framework Theme is a parent theme or child theme */
    
    	define('OPTIONS_FRAMEWORK_URL', get_template_directory() . '/themeOptions/admin/');
    	define('OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/themeOptions/admin/');
    
    require_once (OPTIONS_FRAMEWORK_URL . 'options-framework.php');
    }
    /*
     * This is an example of how to add custom scripts to the options panel.
     * This one shows/hides the an option when a checkbox is clicked.
     */
    add_action('optionsframework_custom_scripts', 'optionsframework_custom_scripts');
    function optionsframework_custom_scripts() { ?>
    <script type="text/javascript">
    jQuery(document).ready(function() {
    	jQuery('#example_showhidden').click(function() {
      		jQuery('#section-example_text_hidden').fadeToggle(400);
    	});
    	if (jQuery('#example_showhidden:checked').val() !== undefined) {
    		jQuery('#section-example_text_hidden').show();
    	}
    });
    </script>
    <?php
    }
    /*
     * Turns off the default options panel from Twenty Eleven
     */
    add_action('after_setup_theme','remove_twentyeleven_options', 100);
    function remove_twentyeleven_options() {
    	remove_action( 'admin_menu', 'twentyeleven_theme_options_add_page' );
    }
    ?>

    Where is the fault?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi heyyitzpat.

    I’m having this issue

    What issue?

    with a theme I uploaded.

    What theme? Where did you download it from?

    Thread Starter heyyitzpat

    (@heyyitzpat)

    The issue is Parse error: syntax error, unexpected ‘{‘ in /home/******/public_html/wp-content/themes/blackfyre/themeOptions/functions.php on line 1

    The theme is Blackfyre

    Since you’re using a commercial theme we’d ask that you post your question with the theme vendor’s support for help with customizations and issues:
    http://themeforest.net/item/blackfyre-create-your-own-gaming-community/10618851/support.
    These forums are for support of themes available in the wordpress.org repository and the volunteers on this forum don’t have access to commercial themes. Support for a commercial theme should have been included when the theme was purchased. Contacting the theme vendor also allows the developers to be aware of potential issues with their products.

    I put the above code through two PHP lint syntax checker and there were no errors found. In addition, I counted the number of left curly braces (6) and it matches with the number of right curly braces (6).

    Maybe the problem is here:
    require_once (OPTIONS_FRAMEWORK_URL . 'options-framework.php');

    Comment out:
    // require_once (OPTIONS_FRAMEWORK_URL . 'options-framework.php');

    Replace with this:

    $thePath = OPTIONS_FRAMEWORK_URL . 'options-framework.php';
    echo "THE PATH IS: " . $thePath;
    require_once($thePath);

    Is $thePath a valid path? Is the file you have corrupted? Delete functions.php and upload it again.

    Hie heyyitzpat,
    The issue might be in the file that is calling “ themeOptions/functions.php” or in “require_once (OPTIONS_FRAMEWORK_URL . ‘options-framework.php’);”
    So please kindle provide code of that do files also.
    Is that theme is running before or from the time you installed it… it is producing the error.
    Thanks

    Thread Starter heyyitzpat

    (@heyyitzpat)

    I put the above code through two PHP lint syntax checker and there were no errors found. In addition, I counted the number of left curly braces (6) and it matches with the number of right curly braces (6).

    Maybe the problem is here:
    require_once (OPTIONS_FRAMEWORK_URL . ‘options-framework.php’);

    Comment out:
    // require_once (OPTIONS_FRAMEWORK_URL . ‘options-framework.php’);

    Replace with this:
    $thePath = OPTIONS_FRAMEWORK_URL . ‘options-framework.php’;
    echo “THE PATH IS: ” . $thePath;
    require_once($thePath);
    Is $thePath a valid path? Is the file you have corrupted? Delete functions.php and upload it again.

    THIS must have fixed it. I replaced what you said to do, and now its working!!!!!! Thank you!!!!!!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Parse error: syntax error, unexpected '}'’ is closed to new replies.