Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1259237
    intveld
    Participant

    Hi guys,

    I tried to change the functions.php file for a certain reason. After removing the addition again, I got this message:
    Parse error: syntax error, unexpected ‘}’, expecting end of file in /www/htdocs/tivdevco/wp-content/themes/x/functions.php on line 152

    The problem is I don’t know where to find line 152. I don’t see any number.

    Ton in ‘t Veld

    #1259240
    intveld
    Participant

    This is the file now:

    <?php

    // =============================================================================
    // FUNCTIONS.PHP
    // —————————————————————————–
    // Theme functions for X.
    // =============================================================================

    // =============================================================================
    // TABLE OF CONTENTS
    // —————————————————————————–
    // 01. Set Paths
    // 02. Require Files
    // =============================================================================

    // Set Paths
    // =============================================================================

    $func_path = ‘framework/functions’;
    $glob_path = ‘framework/functions/global’;
    $admn_path = ‘framework/functions/global/admin’;
    $eque_path = ‘framework/functions/global/enqueue’;
    $plgn_path = ‘framework/functions/global/plugins’;

    // Require Files
    // =============================================================================

    //
    // Debugging, conditionals, helpers, and stack data.
    //

    require_once( $glob_path . ‘/debug.php’ );
    require_once( $glob_path . ‘/conditionals.php’ );
    require_once( $glob_path . ‘/helper.php’ );
    require_once( $glob_path . ‘/stack-data.php’ );
    require_once( $glob_path . ‘/tco-setup.php’ );

    //
    // Admin.
    //

    require_once( $admn_path . ‘/thumbnails/setup.php’ );
    require_once( $admn_path . ‘/setup.php’ );
    require_once( $admn_path . ‘/migration.php’ );
    require_once( $admn_path . ‘/meta/setup.php’ );
    require_once( $admn_path . ‘/sidebars.php’ );
    require_once( $admn_path . ‘/widgets.php’ );
    require_once( $admn_path . ‘/custom-post-types.php’ );
    require_once( $admn_path . ‘/customizer/setup.php’ );
    require_once( $admn_path . ‘/addons/setup.php’ );

    //
    // Enqueue styles and scripts.
    //

    require_once( $eque_path . ‘/styles.php’ );
    require_once( $eque_path . ‘/scripts.php’ );

    //
    // Global functions.
    //

    require_once( $glob_path . ‘/meta.php’ );
    require_once( $glob_path . ‘/featured.php’ );
    require_once( $glob_path . ‘/pagination.php’ );
    require_once( $glob_path . ‘/navbar.php’ );
    require_once( $glob_path . ‘/breadcrumbs.php’ );
    require_once( $glob_path . ‘/classes.php’ );
    require_once( $glob_path . ‘/portfolio.php’ );
    require_once( $glob_path . ‘/social.php’ );
    require_once( $glob_path . ‘/content.php’ );
    require_once( $glob_path . ‘/remove.php’ );

    //
    // Stack specific functions.
    //

    require_once( $func_path . ‘/integrity.php’ );
    require_once( $func_path . ‘/renew.php’ );
    require_once( $func_path . ‘/icon.php’ );
    require_once( $func_path . ‘/ethos.php’ );

    //
    // Integrated plugins.
    //

    require_once( $plgn_path . ‘/cornerstone.php’ );

    if ( X_BBPRESS_IS_ACTIVE ) {
    require_once( $plgn_path . ‘/bbpress.php’ );
    }

    if ( X_BUDDYPRESS_IS_ACTIVE ) {
    require_once( $plgn_path . ‘/buddypress.php’ );
    }

    if ( X_CONVERTPLUG_IS_ACTIVE ) {
    require_once( $plgn_path . ‘/convertplug.php’ );
    }

    if ( X_ENVIRA_GALLERY_IS_ACTIVE ) {
    require_once( $plgn_path . ‘/envira-gallery.php’ );
    }

    if ( X_ESSENTIAL_GRID_IS_ACTIVE ) {
    require_once( $plgn_path . ‘/essential-grid.php’ );
    }

    if ( X_LAYERSLIDER_IS_ACTIVE ) {
    require_once( $plgn_path . ‘/layerslider.php’ );
    }

    if ( X_REVOLUTION_SLIDER_IS_ACTIVE ) {
    require_once( $plgn_path . ‘/revolution-slider.php’ );
    }

    if ( X_SOLILOQUY_IS_ACTIVE ) {
    require_once( $plgn_path . ‘/soliloquy.php’ );
    }

    if ( X_VISUAL_COMOPSER_IS_ACTIVE ) {
    require_once( $plgn_path . ‘/visual-composer.php’ );
    }

    if ( X_WOOCOMMERCE_IS_ACTIVE ) {
    require_once( $plgn_path . ‘/woocommerce.php’ );
    }

    if ( X_WPML_IS_ACTIVE ) {
    require_once( $plgn_path . ‘/wpml.php’ );
    }

    if ( X_UBERMENU_IS_ACTIVE ) {
    require_once( $plgn_path . ‘/ubermenu.php’ );
    }

    if ( X_THE_GRID_IS_ACTIVE && x_is_validated() ) {
    require_once( $plgn_path . ‘/the-grid.php’ );
    }

    if ( X_EP_PAYMENT_FORM_IS_ACTIVE ) {
    require_once $plgn_path . ‘/estimation-form.php’;
    }

    #1259287
    Paul R
    Moderator

    Hi,

    Please change the entire code in your functions.php file with this.

    
    <?php
    
    // =============================================================================
    // FUNCTIONS.PHP
    // -----------------------------------------------------------------------------
    // Theme functions for X.
    // =============================================================================
    
    // =============================================================================
    // TABLE OF CONTENTS
    // -----------------------------------------------------------------------------
    //   01. Set Paths
    //   02. Require Files
    // =============================================================================
    
    // Set Paths
    // =============================================================================
    
    $func_path = 'framework/functions';
    $glob_path = 'framework/functions/global';
    $admn_path = 'framework/functions/global/admin';
    $eque_path = 'framework/functions/global/enqueue';
    $plgn_path = 'framework/functions/global/plugins';
    
    // Require Files
    // =============================================================================
    
    //
    // Debugging, conditionals, helpers, and stack data.
    //
    
    require_once( $glob_path . '/debug.php' );
    require_once( $glob_path . '/conditionals.php' );
    require_once( $glob_path . '/helper.php' );
    require_once( $glob_path . '/stack-data.php' );
    require_once( $glob_path . '/tco-setup.php' );
    
    //
    // Admin.
    //
    
    require_once( $admn_path . '/thumbnails/setup.php' );
    require_once( $admn_path . '/setup.php' );
    require_once( $admn_path . '/migration.php' );
    require_once( $admn_path . '/meta/setup.php' );
    require_once( $admn_path . '/sidebars.php' );
    require_once( $admn_path . '/widgets.php' );
    require_once( $admn_path . '/custom-post-types.php' );
    require_once( $admn_path . '/customizer/setup.php' );
    require_once( $admn_path . '/addons/setup.php' );
    
    //
    // Enqueue styles and scripts.
    //
    
    require_once( $eque_path . '/styles.php' );
    require_once( $eque_path . '/scripts.php' );
    
    //
    // Global functions.
    //
    
    require_once( $glob_path . '/meta.php' );
    require_once( $glob_path . '/featured.php' );
    require_once( $glob_path . '/pagination.php' );
    require_once( $glob_path . '/navbar.php' );
    require_once( $glob_path . '/breadcrumbs.php' );
    require_once( $glob_path . '/classes.php' );
    require_once( $glob_path . '/portfolio.php' );
    require_once( $glob_path . '/social.php' );
    require_once( $glob_path . '/content.php' );
    require_once( $glob_path . '/remove.php' );
    
    //
    // Stack specific functions.
    //
    
    require_once( $func_path . '/integrity.php' );
    require_once( $func_path . '/renew.php' );
    require_once( $func_path . '/icon.php' );
    require_once( $func_path . '/ethos.php' );
    
    //
    // Integrated plugins.
    //
    
    require_once( $plgn_path . '/cornerstone.php' );
    
    if ( X_BBPRESS_IS_ACTIVE ) {
      require_once( $plgn_path . '/bbpress.php' );
    }
    
    if ( X_BUDDYPRESS_IS_ACTIVE ) {
      require_once( $plgn_path . '/buddypress.php' );
    }
    
    if ( X_CONVERTPLUG_IS_ACTIVE ) {
      require_once( $plgn_path . '/convertplug.php' );
    }
    
    if ( X_ENVIRA_GALLERY_IS_ACTIVE ) {
      require_once( $plgn_path . '/envira-gallery.php' );
    }
    
    if ( X_ESSENTIAL_GRID_IS_ACTIVE ) {
      require_once( $plgn_path . '/essential-grid.php' );
    }
    
    if ( X_LAYERSLIDER_IS_ACTIVE ) {
      require_once( $plgn_path . '/layerslider.php' );
    }
    
    if ( X_REVOLUTION_SLIDER_IS_ACTIVE ) {
      require_once( $plgn_path . '/revolution-slider.php' );
    }
    
    if ( X_SOLILOQUY_IS_ACTIVE ) {
      require_once( $plgn_path . '/soliloquy.php' );
    }
    
    if ( X_VISUAL_COMOPSER_IS_ACTIVE ) {
      require_once( $plgn_path . '/visual-composer.php' );
    }
    
    if ( X_WOOCOMMERCE_IS_ACTIVE ) {
      require_once( $plgn_path . '/woocommerce.php' );
    }
    
    if ( X_WPML_IS_ACTIVE ) {
      require_once( $plgn_path . '/wpml.php' );
    }
    
    if ( X_UBERMENU_IS_ACTIVE ) {
      require_once( $plgn_path . '/ubermenu.php' );
    }
    
    if ( X_THE_GRID_IS_ACTIVE && x_is_validated() ) {
    	require_once( $plgn_path . '/the-grid.php' );
    }
    
    if ( X_EP_PAYMENT_FORM_IS_ACTIVE ) {
    	require_once $plgn_path . '/estimation-form.php';
    }
    

    We don’t recommend editing the parent theme functions.php file as it will get overwritten during theme updates.

    Please set-up a child theme and add your codes in the child theme’s functions.php file.

    https://community.theme.co/kb/how-to-setup-child-themes/

    Thanks

    #1259293
    intveld
    Participant

    Thanks for the file Paul, but it doesn’t work…

    I already copied the functions.php file from another site I made with X.

    And yes, you are right about parent and child theme, but I didn’t update the theme at all.

    #1259434
    intveld
    Participant

    Fortunately my hosting provider could place back a back up of last night.
    Thanks anyway.

    #1259443
    Christian
    Moderator

    Glad it’s fixed. If you’re not familiar with PHP, it is best to have a third party developer work on PHP files.

    Thanks.

  • <script> jQuery(function($){ $("#no-reply-1259237 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>