WordPress.org

Forums

Functions.php downed site (11 posts)

  1. Chip G.
    Member
    Posted 1 year ago #

    site: CharlieBubblesBook.com

    Pasted, Theme functions: remove_action( 'woocommerce_pagination', 'woocommerce_catalog_ordering', 20 ); into Functions.php.

    Received, Parse error: syntax error, unexpected T_STRING in /home/charlieb/public_html/wp/wp-content/themes/twentytwelve-child/functions.php on line 6

    How do I get back? Please.

  2. catacaustic
    very awesome
    Posted 1 year ago #

    Remove the part that you posted in.

    The problem is that we don't know what line 6 is, and even if it is that string that you have givne now, there could be an error on the line above it that's causing this to happen. If you can't get it to work, paste the files contents here (but remove the database connection details and any other identfing data first) so we can see what you're dealing with.

  3. Chip G.
    Member
    Posted 1 year ago #

    Initially, I removed the code I pasted from the Edit Themes functions.php page. Where do I find the requested file contents you would like to be pasted here?

  4. catacaustic
    very awesome
    Posted 1 year ago #

    As it's broken your site, you'll need to use FTP to get onto your hosting server and download the file from there.

    When you figure i tout you will then use FTP to place the file back on the server, and that shouldl fix it all. Another option is to upload a fresh un-changed copy of the functions.php file from a new download of the theme. That will give you the same results - unless you've changed other things as well.

  5. Chip G.
    Member
    Posted 1 year ago #

    <?php
    /**
    * Administration Functions
    *
    * This file is deprecated, use 'wp-admin/includes/admin.php' instead.
    *
    * @deprecated 2.5.0
    * @package WordPress
    * @subpackage Administration
    */

    _deprecated_file( basename(__FILE__), '2.5', 'wp-admin/includes/admin.php' );

    /** WordPress Administration API: Includes all Administration functions. */
    require_once(ABSPATH . 'wp-admin/includes/admin.php');

  6. catacaustic
    very awesome
    Posted 1 year ago #

    What file is that from? It's not your functions.php file that is causing the error. That's the file that you need to reset.

    /wp-content/themes/twentytwelve-child/functions.php

  7. Chip G.
    Member
    Posted 1 year ago #

    Okay, via FTP I have accessed my '/wp-content/themes/twentytwelve-child/functions.php' file which is a long page of code. What specifically am I looking for to fix the code?

  8. catacaustic
    very awesome
    Posted 1 year ago #

    Parse error: syntax error, unexpected T_STRING in /home/charlieb/public_html/wp/wp-content/themes/twentytwelve-child/functions.php on line 6

    And as I said before:

    The problem is that we don't know what line 6 is, and even if it is that string that you have givne now, there could be an error on the line above it that's causing this to happen. If you can't get it to work, paste the files contents here (but remove the database connection details and any other identfing data first) so we can see what you're dealing with.

  9. Chip G.
    Member
    Posted 1 year ago #

    <?php
    // Exit if accessed directly
    if ( !defined('ABSPATH')) exit;

    /* Add custom functions below */
    Theme functions: remove_action( 'woocommerce_pagination', 'woocommerce_catalog_ordering', 20 );

  10. catacaustic
    very awesome
    Posted 1 year ago #

    The problem is pretty easy to see (well, to a developer at least).

    The text of Theme functions: should not be in there. It should be this:

    <?php
    // Exit if accessed directly
    if ( !defined('ABSPATH')) exit;
    
    /* Add custom functions below */
    remove_action( 'woocommerce_pagination', 'woocommerce_catalog_ordering', 20 );
  11. Chip G.
    Member
    Posted 1 year ago #

    Site is back up and running. Although the WooCommerce 'Default Sorting' dropdown is still there, which that code was to remove. No worries, after all that I'll leave it there.

    I thank you very much. A bit overwhelming for an amateur. Glad you are here.

Topic Closed

This topic has been closed to new replies.

About this Topic