• Resolved JonnieMorganBand

    (@jonniemorganband)


    Hello all,

    I just need someone to give me a quick fix that somehow was was corrupted.

    Here is the error message I get;

    “Parse error: syntax error, unexpected T_STRING in /home2/jonniemo/public_html/wp-content/themes/twentyten/functions.php on line 444”

    Here is the chunk of code I was working with (line 444 is line 4 of the code below… “sprintf…);

    function twentyten_posted_on() {
    	printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten' ),
    		'meta-prep meta-prep-author',
    		sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>',
    			get_permalink(),
    			esc_attr( get_the_time() ),
    			get_the_date()
    		),
    		sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
    			get_author_posts_url( get_the_author_meta( 'ID' ) ),
    			sprintf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ),
    			get_the_author()
    		)
    	);
    }

    I’m assuming I’m just missing a simple tag… any help would be very much appreciated!

    -Matt

Viewing 6 replies - 1 through 6 (of 6 total)
  • I couldn’t spot the error but here’s the original function:

    function twentyten_posted_on() {
    	printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten' ),
    		'meta-prep meta-prep-author',
    		sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>',
    			get_permalink(),
    			esc_attr( get_the_time() ),
    			get_the_date()
    		),
    		sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
    			get_author_posts_url( get_the_author_meta( 'ID' ) ),
    			sprintf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ),
    			get_the_author()
    		)
    	);
    }
    Thread Starter JonnieMorganBand

    (@jonniemorganband)

    esmi, thank you for the quick reply!

    I went to try and paste the original, but now I can’t even get back into the Dashboard!

    I just get the error code… I’m freaking out, how can I get back into the Dashboard to try and fix the functions.php file…?

    (also just realized I posted this in two different sections – MODS if you could delete the other one – thanks!)

    Second topic deleted.

    It sounds like you have errors elsewhere in the functions.php file. Download a fresh copy of TwentyTen, extract the functions.php file and upload it to your wp-content/themes/twentyten folder using FTP (or whatever file management application your host provides).

    If you’re modifying that theme, you’d be far better off creating a child theme. Otherwise, your changes will only be overwritten next time you upgrade WordPress.

    Thread Starter JonnieMorganBand

    (@jonniemorganband)

    Worked! Excellent advice, thank you esmi!

    And thank you for informing me about child themes! This is a must for what I am doing, glad I was made aware of it early on!

    Thanks!

    You’re welcome. ??

    Hello there WP fans. I am having the same issue and I have tried all the above and more. I have looked at it carefully and cannot get it to function. I get the same error for every page that I try to call.

    Is there anyway to get into the code and change the theme it calls, then delete the twenty-ten, then re-install it and change it back via the admin panel? That’s all I got left before I have to start from 1. What a drag this is. It was SO stable too.

    I cannot detect any syntax errors at all between what is live on my site (via ftp) and the ones that are above.

    Help….

    Jonathan @ Black Sun

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Need a quick parse/syntax error fix’ is closed to new replies.