First make sure that the backup does not have the same problem and is being restored correctly i.e it uploads and replaces the problematic file.
There seems to be a problem with your opening and closing PHP tags: <?php and ?>. Most common problem is missing a closing PHP tag and writing HTML next to it. Start looking for the problem around line 28 as stated by the error.
Thanks.
I’m stumped, line 28 doesn’t even exist.
it finishes on line 26.
Line 28 was the first line of the new code I entered, but for some reason replacing it with the backed up functions.php file isn’t fixing the problem.
I’m using Cyberduck FTP to put the files back, and it’s in the child theme folder.
is it possible WP has made edits elsewhere?
here’s the contents of the functions.php file
<?php
// =============================================================================
// FUNCTIONS.PHP
// —————————————————————————–
// Overwrite or add your own custom functions to X in this file.
// =============================================================================
// =============================================================================
// TABLE OF CONTENTS
// —————————————————————————–
// 01. Enqueue Parent Stylesheet
// 02. Additional Functions
// =============================================================================
// Enqueue Parent Stylesheet
// =============================================================================
add_filter( ‘x_enqueue_parent_stylesheet’, ‘__return_true’ );
// Additional Functions
// =============================================================================
It’s highly unlikely that WP will make file changes unless you or the theme coded it to do so. Do you still have the piece of code that you added?
Also, can you try downloading the functions.php file from your FTP and see if the code you added has really been removed? If the content is the same like what you posted then it might be referring to the functions.php file of your parent theme, so you can check that as well.
Did you ever figure out how to fix this? I’m having the same issue–I replaced the file with a fresh one a number of times. Getting the same syntax error for a line that doesn’t exist.