• Hi everyone,

    I was trying to remove the Posted by section on my blog, and had been researching Child Themes, but couldn’t quite figure it out. I think I made a stupid decision and tried to remove a piece of coding from Template-Tags.php. Now I’m getting this every time I try to open a page: Parse error: syntax error, unexpected T_FUNCTION on line 72

    Here’s the area I changed:

    * Prints HTML with meta information for the current post-date/time and author.
    */
    function ys_magazine_posted_on() { <—-this should be line 72
    $time_string = ‘<time class=”entry-date published updated” datetime=”%1$s”>%2$s</time>’;
    if ( get_the_time( ‘U’ ) !== get_the_modified_time( ‘U’ ) ) {
    $time_string = ‘<time class=”entry-date published” datetime=”%1$s”>%2$s</time><time class=”updated” datetime=”%3$s”>%4$s</time>’;

    Please help.

    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Bill

    (@chubbycrow)

    Easiest fix is to replace the edited one on your hosting account server with a fresh, unedited one. You can use an FTP client (like FileZilla), or your web-host’s cPanel or file manager to do this. File manager is easiest if you aren’t familiar with ftp.

    Find a copy of it in a freshly-downloaded copy of the theme. Copy the bad one from the server to your computer for reference, delete it from the server, and upload the new one.

    Whenever you want to make any changes to your theme, you should make them to a child theme instead. That way you won’t lose your changes when the parent theme gets updated. A child theme is not difficult to make and can save you a lot of trouble in the future.

    Thread Starter JCCaito7

    (@jccaito7)

    What if I don’t have access to hosting account server? The site is being hosted by someone that I do not have access to at this time.

    Any other options?

    Bill

    (@chubbycrow)

    If you can access the theme administration page (Appearance > Themes), you could switch themes to maybe a default WP theme, delete the problem theme, and then re-install and re-activate it (but only if it is available in the WP repository). Any user-created changes that may have been made to the theme will be lost, of course.

    Thread Starter JCCaito7

    (@jccaito7)

    Now I can’t even access the WordPress Login page without getting the error.

    All I did was add something after the bracket on line 72, updated, it did not work, so I deleted it and updated again. Something that simple could cause this?

    Bill

    (@chubbycrow)

    Something that simple could cause this?

    Absolutely.

    It follows that without access to the file (or theme), not much can be done. You either need to contact someone who does have access, or convince the web host to assist you. That will be difficult if the account is not yours. Sorry.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Parse error: syntax error, unexpected T_FUNCTION’ is closed to new replies.