• Morning,

    Yesterday I was finishing my own website when I wrote a wrong string code that locked me out of WordPress, now I can’t access at any single part of my website. Today I use Filezilla to substitute the wrong string using the original one provided by a backup that I made few days ago. But my website is still not working. I’m already locked out and when I try to direct on the homepage this written appear on the monitor “Parse error: syntax error, unexpected ‘2016’ (T_LNUMBER), expecting identifier (T_STRING) or variable (T_VARIABLE) or ‘{‘ or ‘$’ in /web/htdocs/www.patriarcadesign.it/home/wp-content/themes/mint/functions.php on line 40” that is the same written that appears when I wrote the wrong code. But if I see on Filezilla the string Functions.php is correct!! I don’t know what I have to do, please help me! Thanks for attention!

Viewing 15 replies - 1 through 15 (of 25 total)
  • Hello stepat93,

    Try clearing your cache. If you have varnish or any other caching plugin that was installed on your site. Also can you provide the code that was on functions.php?

    Regards

    Thread Starter stepat93

    (@stepat93)

    That was the code I’ve put in the original one, the mistake is that I write 2016 instead firsdate in the if cicle after dates [0] (I’m not good using code and it is not the first time I made a mistake but never happens something like this). How can I clear the cache without acceding to my administrator panel? Using Filezilla?

    function data_copyright() {
    global $wpdb;
    $copyright_dates = $wpdb->get_results(”
    SELECT
    YEAR(min(post_date_gmt)) AS firstdate,
    YEAR(max(post_date_gmt)) AS lastdate
    FROM
    $wpdb->posts
    WHERE
    post_status = ‘publish’
    “);
    $output = ”;
    if($copyright_dates) {
    $copyright = “© ” . $copyright_dates[0]->firstdate;
    if($copyright_dates[0]->firstdate != $copyright_dates[0]->lastdate) {
    $copyright .= ‘-‘ . $copyright_dates[0]->lastdate;
    }
    $output = $copyright;
    }
    return $output;
    }

    Hello stepat93,

    Thanks for providing the details.The code seems to be fine although I am a bit curious to know what’s the purpose of this function. Anyways, try to rename your plugins directory using filezilla and try to access your site. Also if you could let me know the plugin you are using for caching on the site then I may provide you exact information on how to clear cache for that plugin.

    First, try to rename the plugins directory and try accessing your site also try to access other URLs on your site and see if that works.

    Regards

    Thread Starter stepat93

    (@stepat93)

    The plugins directory is the folder in the main menù where there are all the plugins that I installed? Sorry but I’m italian and my english is very poor and talking about this thins in foreign language it is difficult for me ??

    I understand but you seem to be writing really good English :). Just go to filezilla and navigate to wp-content directory. There you can see plugins folder just rename it. Also can you share your website url ?

    Thread Starter stepat93

    (@stepat93)

    OK, I rename the plugins directory (I call it pluginsrename), now whah the next step is?My website url is https://www.patriarcadesign.it

    Can you try to change your function with this?

    
    function data_copyright() {
    global $wpdb;
    $copyright_dates = $wpdb->get_results("
    SELECT
    YEAR(min(post_date_gmt)) AS firstdate,
    YEAR(max(post_date_gmt)) AS lastdate
    FROM
    $wpdb->posts
    WHERE
    post_status = 'publish'
    ");
    $output = '';
    if($copyright_dates) {
    $copyright = "©" . $copyright_dates[0]->firstdate;
    if($copyright_dates[0]->firstdate != $copyright_dates[0]->lastdate) {
    $copyright .= '-' . $copyright_dates[0]->lastdate;
    }
    $output = $copyright;
    }
    return $output;
    }
    

    And revert back the plugin folder name to what it was.

    • This reply was modified 7 years, 11 months ago by MagniGeeks.
    Thread Starter stepat93

    (@stepat93)

    Where have I write this code? In the Functions.php?

    <?php
    $theme_dir = get_template_directory();

    require_once $theme_dir . ‘/classes/Theme.php’;
    require_once $theme_dir . ‘/classes/CSS.php’;
    require_once $theme_dir . ‘/classes/Setup.php’;
    require_once $theme_dir . ‘/classes/Options.php’;
    require_once $theme_dir . ‘/classes/Helpers.php’;
    require_once $theme_dir . ‘/classes/Modules.php’;
    require_once $theme_dir . ‘/classes/PostFormats.php’;
    require_once $theme_dir . ‘/classes/Shop.php’;
    require_once $theme_dir . ‘/classes/Addons.php’;

    require_once $theme_dir . ‘/plugins/tgm-plugin-activation/init.php’;

    if (!MintOptions::get(‘general–wp_version’)) {
    remove_action( ‘wp_head’, ‘wp_generator’ );
    }
    if (!MintOptions::get(‘general–wlwmanifest’)) {
    remove_action( ‘wp_head’, ‘wlwmanifest_link’ );
    }
    if (!MintOptions::get(‘general–rsd’)) {
    remove_action( ‘wp_head’, ‘rsd_link’ );
    }

    Just replace the code you sent above with this.

    Thread Starter stepat93

    (@stepat93)

    I replace the code but it still responds with the same error. The thing that I don’t understand is why the error reports “.. on line 40” when the code has only 21 lines!

    Thread Starter stepat93

    (@stepat93)

    I’ve read about the possibility to remove completely the theme Mint so WordPress could switch in automatic on a default theme. So after I could upload the theme, that will be downloaded again from themeforest (where I buy it), that probably must be correct. I don’t care about the theme, what is important for me are the contents because I spent more than a month to do them.

    Thread Starter stepat93

    (@stepat93)

    It is possible that it doesn’t work because I don’t installed WordPress correctly in Filezilla?

    Oh okay, then you should just rename the theme directory you are using and the issue would be gone.

    Regards

    It doesn’t seem to be issue with WordPress it’s the issue with your theme. Just rename mint to mint-old or something else and it would work.

    Thread Starter stepat93

    (@stepat93)

    Just rename? or could I delete it? so after I could upload it correctly from the administration panel. In case, I have to rename the theme directory that consists in the name of the theme?

Viewing 15 replies - 1 through 15 (of 25 total)
  • The topic ‘Parse Error’ is closed to new replies.