HELP Parse error: syntax error, unexpected
-
I’ve just started up a new website with this great theme. I consulted Thomas’ website “How to use Tiny Framework Child themes” for how to enable HTML code in title, and then took a look at the functions.php in the (non-child) TF theme. In this document, I referred to:
“If you use Tiny Framework without a child theme, open functions.php in a text editor, find section 5.11 (Change title for protected and private posts…) and in tinyforge_the_title_trim function comment out this line:…”
I copied the functions.php from the WP editor into a text editor, tried following instructions, then pasted the whole document back into the proper place in the WP editor, then updated. WHen I did this is what happened:
Parse error: syntax error, unexpected ‘}’, expecting elseif (T_ELSEIF) or else (T_ELSE) or endif (T_ENDIF) in /home/bitsb/backinthesameboat.com/wp-content/themes/tiny-framework/functions.php on line 721
I used the back button on my browser to return to the editor. I’d somehow introduced a problem and don’t know how, but then I copied the original functions.php document from my backup and pasted it into the WP editor, then updated. The parse error returned.
Now I don’t know what to do, and I can’t leave the WP editor page for fear that I won’t be able to fix this problem. My website is now unfunctional and I’m in a panic. What do I do?
If it would help, here are the lines in question as they appear in the original functions.php file (they look the same to me on the WP editor page, too):
function tinyframework_the_title_trim($title) {
$title = esc_attr($title); // Sanitize HTML characters in the title. Comment out this line if you want to use HTML in post titles.
$findthese = array(
‘#Protected:#’,
‘#Private:#’
);
$replacewith = array(
// What to replace “Protected:” with
‘<span class=”screen-reader-text”>Protected article:</span>’,
// What to replace “Private:” with
‘<span class=”screen-reader-text”>Private article:</span>’
);
$title = preg_replace($findthese, $replacewith, $title);
return $title;
}
endif;
add_filter( ‘the_title’, ‘tinyframework_the_title_trim’ );The page I need help with: [log in to see the link]
- The topic ‘HELP Parse error: syntax error, unexpected’ is closed to new replies.