• brainstain

    (@brainstain)


    I was trying to remove the date feature, couldnt find exact location, so just searched in each template for the words “Posted on”, and found it in functions.php,

    Carefully remarked out two lines, making sure any matching brackets still existed, but when I clicked button to Update File, I got a white screen that said,

    “Parse error: syntax error, unexpected ‘<‘, expecting ‘)’ in /home/content/49/6513249/html/wellness/wp-content/themes/twentyeleven/functions.php on line 567”

    Did a backpage to get back to code.
    Went to other browser and downloaded original theme, opened functions.php in notepad, copied all, pasted all the same code back in,
    clicked Update File, and get the same error, cant go to any other link within Admin area, always get the error msg, what to do?

    Pasted the original freshly downloaded code into html editing tool, and found that line 567 was this near the bottom in function

    twentyeleven_posted_on()

    and a few lines below that is line 567, this code:

    esc_url( get_author_posts_url( get_the_author_meta( ‘ID’ ) ) ),

    but dont see the unexpected < to replace it with a ) so I am still lost.

    Have already customised (not code) many features, non of which caused errors, am I up a creek?

    Thanks.

    BrainStain

    https://www.ads-software.com/extend/themes/twentyeleven/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello!

    I am having EXACTLY the same problem, did you find out how to solve it? Please its driving me crazy!

    Are you using a child theme of Twenty Eleven – as described here?
    https://codex.www.ads-software.com/Child_Themes

    If you are, then you shouldn’t need to copy functions.php wholesale — just copy the functions that need to be modified. The file referenced above, twentyeleven/functions.php, would never need to be changed.

    Doing it that way might not solve this problem for you immediately, but it should make it easier to debug.

    Thread Starter brainstain

    (@brainstain)

    Took me awhile to remember and find what I did.

    First of all read this:
    I MAKE NO GUARANTEE THIS WILL WORK, I TAKE NO RESPONSIBILITY OF YOUR EDITING OF YOUR CODE, blah blah blah, you know what I mean, This is my best guess at what I did, and its working, no posted on dates are showing.

    It doesnt hurt to copy all the pages code and keep it in notepad on your computer to reinsert it in case something goes bad, to have the original code, just a thought.

    Now, what I also must say, is that I didnt have any real content at the time, so it didnt bother me to dump the whole theme, and re-upload it, re-install it, just to get rid of the error problem that I never got solved. Cant help you on fixing the error message, no one ever came to help, so I had to resort to reinstalling the whole theme.
    I think I even reinstalled the database to try and fix it, no good.

    So, if you have to go thru all that, get it working again, and still want to get rid of the timely date stamp so your posts wont show any age, like I did, here is what “I THINK I DID”.

    The code to look for is NOT in the functions.php, the functions.php just calls the variable from another page. Also note that Im not a real life programmer, I only play one on television, (little humor there) so dont hold me to the programming language when I say variable.

    Im just meaning that the functions.php has some workings of the “posted on” code, but is actually calling the constant from another page (another programmers term which makes me sound authoritative, but its just a front)

    The page you want to edit is the…drumroll…..content-single.php ,
    the code to edit is near the top. And when I say edit, I mean only adding a comment bracket to the line, not removing it.

    Look at the top, for <article id= and buried about 5 lines below that youll find :

    <div class=”entry-meta”>
    <?php twentyeleven_posted_on(); ?>
    </div><!– .entry-meta –>

    add the html comment code <!– at the beginning of the middle line, and end that same line with –> which is the closing code for a comment.

    All of this Im sure you know, but just had to say this as referrence.
    So the code will now look like this”

    <div class=”entry-meta”>
    <!– <?php twentyeleven_posted_on(); ?> –>
    </div><!– .entry-meta –>

    So this being remarked out, transfers to the functions.php page which doesnt pass on the ability to print the date, or the posted on words.

    Ok, thats what I remember doing, took a lot of searching to find that, many cups of coffee, reloading my database, and re-installing the initial code, but its working.

    Hope this helps, and oh, the tip-jar is over on the piano, and I dont like the kind that makes noise, haha.

    Best wishes.

    BrainStain

    Thank you so much for all this information!

    converting2wp it′s not the child theme, I know I should have done that before “playing” with the code ó_ò

    The thing is I still have open the functions.php editor and was hoping to find a solution before dump everything, just to restore the theme (and then I will “play” with the date and posting code. I have tried to copy the original code and a few things more (like changing another part to see if the error changes) but doesnt matter what I do is always the same error.

    Any thoughts?

    If not I wil reinstall everything as you said. Thanks so much brainstain! ??

    Thread Starter brainstain

    (@brainstain)

    Youre welcome. Unfortunately I tried what youre trying, pasting the original code back into function.php, and it never worked. Doesnt make sense. It must set some variable when the code got changed, and requires something else to set it back, I dont know.

    I looked for a plugin first to suppress the date but couldnt find it, thats when I started messing with the code, but messed with it in the wrong area just because I (and you) found the words “Posted on” found in that php file, but oh well.

    Sorry I cant help more than that. Hope you wont lose too much. I guess copy all your content to notepad, save on hard drive, then repaste once its running again.

    BrainStain

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Theme: Twenty Eleven] Edited functions.php, now error at line 567’ is closed to new replies.