• Resolved pimlico35

    (@pimlico35)


    Hi,

    Ive been helping to make changes to a website (created by someone else) in WordPress; not being that familiar with php )more of a dreamweaver type) I made some changes to the code on the wp site. All was going well… copied some code to make changes to a page and got a parsing error in the functions.php page – anyway, I couldnt get back into wp to change. Have copy of original files and original developer has given me access to cpanel. Ftp’d the functions.php but now receiving another error. As I made a few changes to the website, I think a fresh install of the backup might be the best way forward and then work (very carefully!) to make changes again – should be easier now I have cpanel access.

    To cut a long story short: Im not sure which files to upload to get the website back?

    There are some directories in cpanel for:

    public-html (with wp-content, wp-includes and wp-admin

    theres also another directory for: www

    which also has the above folders.

    Im not sure where to start and dont want to confuse matters any more…

    Help most gratefully received…. thank you

    website: http://www.guiatourguides.co.uk/wp-admin/

Viewing 15 replies - 1 through 15 (of 23 total)
  • Obviously it’s recommended that you restore from a backup, and you should replace the current contents of wp-content with the same from the restoration files.

    Even better, just restore the child theme directory.

    Moderator t-p

    (@t-p)

    got a parsing error in the functions.php page

    What is the full error? Please report the full error.

    Thread Starter pimlico35

    (@pimlico35)

    Thanks.

    Tara: original error:

    Parse error: syntax error, unexpected ‘}’ in /home/guiatour/public_html/wp-content/themes/guia/functions.php on line 69

    I uploaded the functions.php and now have a different error:

    Fatal error: Call to undefined function add_filter() in /home/guiatour/public_html/wp-includes/default-filters.php on line 17

    Im going around in circles a bit – thats why i think it might be better to reinstall the whole thing.

    Christian: not sure which are the child themes…. sorry its been a while since ive done this… πŸ™

    thanks

    Also do you have a functions.php file in your wp-content folder? That is where add_filter() is declared. Check in functions.php for an add_filter() function. If it is not there you probably have a corrupt functions.php file.

    Restore from an old backup, or copy over a the default working functions.php from a fresh wordpress download and just replace it that way.

    copy over a the default working functions.php from a fresh wordpress download and just replace it that way.

    @evan: Function files are unique to the theme, that is the purpose of a theme’s functions file. Any functions that are meant for multiple themes are (following best practices) placed in plug-ins, custom or otherwise. DO NOT upload a functions.php file from another theme.

    @pimlico: Restoring from a daily backup is fine, if it was working yesterday. Alternatively, use pastebin to show us the contents of the current functions.php file and we’ll see if we can see the problem.

    Thread Starter pimlico35

    (@pimlico35)

    Thanks – have followed the link and changed the order of the 2; have looked in the functions.php and dont see an add_filter function. Im a bit confused as there are 7 functions.php files on the backup. they range from

    public_html\wp-content\plugins\contact form…
    public_html\wp-content\plugins\sitepress\multilingual…
    public_html\wp-content\plugins\nextgen-gallery…
    public_html\wp-content\themes\twentyten
    public_html\wp-content\plugins\themes\guia
    public_html\wp-includes

    Not sure if i can download a functions.php file from wordpress ??

    Moderator t-p

    (@t-p)

    Parse errors
    Syntax Error:

    A syntax error means that you have made a mistake while creating your PHP structure. You could, for example, be;
    β–  Missing a ; at the end of an individual line.
    β–  Using curly quotation marks.
    β–  Missing a curly bracket.

    When this error appears it will tell you which file the error appears in (functions.php for example) and approximately which line (it may not always be the exact line so be sure to check just before and just after) in the code.

    Unexpected:

    If you are receiving an error which says ‘parse error: unexpected’ this usually means that you have forgotten to include a character. In your case:
    β–  Unexpected ‘}’ : you have forgotten to include the opening }

    @pimlico: First of all, you should NEVER EDIT CORE. Any changes you make will be replaced upon the next update of WordPress, which are very important to ensure the security of your website. Whatever changes were made to wp-settings.php, I’d recommend to immediately revert to the original.

    Secondly, the function add_filter is defined in wp-includes/plugin.php. Calls to that function would occur… literally all over WordPress. Specifically, the current error is being thrown from default-filters.php.

    Again, how much work was done today that would be lost if you restored from yesterday’s backup? I would restore, and let us know how that went. Modifying core is NOT THE ANSWER!1

    Thread Starter pimlico35

    (@pimlico35)

    okay, will copy the funcitons.php file – question is which functions.php will I copy – sorry getting into a muddle due to the number of functions.php in backup. the one Ive assumed is correct one the: public_html\wp-includes –

    http://pastebin.com/941HR1hg#

    thanks

    Edit: Are you able to reach the admin panel? What is your active theme?

    public_html\wp-content\plugins\contact form…
    public_html\wp-content\plugins\sitepress\multilingual…
    public_html\wp-content\plugins\nextgen-gallery…
    public_html\wp-content\themes\twentyten
    public_html\wp-content\plugins\themes\guia
    public_html\wp-includes

    I bolded the ones that are important for us to see.

    Thread Starter pimlico35

    (@pimlico35)

    Thanks – have revised changes back to wp-settings.php original

    Moderator t-p

    (@t-p)

    look for functions.php in you current theme’s directory
    /wp-content/themes/your theme/

    Thread Starter pimlico35

    (@pimlico35)

    Thanks Tara, have reinstated the original php into that directory – it still contained the file with the parse error..

    Thread Starter pimlico35

    (@pimlico35)

    sorry the functions.php file;

    http://pastebin.com/ndndnzNX

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘parse errors & now locked out; not sure which files to upload to reinstate! Help’ is closed to new replies.