WordPress.org

Forums

[resolved] Theme Functions php Error (8 posts)

  1. jaydokie
    Member
    Posted 2 years ago #

    I was attempting to insert <?php if(function_exists('wp_content_slider')) { wp_content_slider(); } ?> into my Theme Functions file (functions.php) and I get the following error on http://roundhousetalk.com:

    <a href="syntax error, unexpected '<' in /home/roundh9/public_html/wp-content/themes/twentyeleven/functions.php on line 602">

    I attempted to remove the php I inserted above, but it doesn't change the error. I think this is line 602:

    function twentyeleven_posted_on() {
    	printf( __( '<span class="sep">Posted on </span></a><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'twentyeleven' ),
    		esc_url( get_permalink() ),
    		esc_attr( get_the_time() ),
    		esc_attr( get_the_date( 'c' ) ),
    		esc_html( get_the_date() ),
    		esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    		esc_attr( sprintf( __( 'View all posts by %s', 'twentyeleven' ), get_the_author() ) ),
    		get_the_author()
    	);
    }
    endif;

    It looks like the sprint line above is 602. My site is completely down. If my file is corrupted and can't be resolved, would migrating it from twenty eleven to twenty twelve resolve it without a major rebuilding? It's really important. Thanks.

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum's parser.]

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    Do not edit the Twenty Eleven theme. It is the default WordPress theme and having access to an unedited version of the theme is vital when dealing with a range of site issues. First create a child theme for your changes.

  3. jaydokie
    Member
    Posted 2 years ago #

    But since I did, how can I fix it? I only inserted it because the plugin instructions said to use the functions.php. How can I resolve this? Thanks.

  4. esmi
    Forum Moderator
    Posted 2 years ago #

    Re-upload a fresh, unpacked, copy of the Twenty Eleven folder to wp-content/themes using FTP or whatever file management application your host provides.
    http://wordpress.org/extend/themes/twentyeleven

  5. jaydokie
    Member
    Posted 2 years ago #

    Could I unpack it in my pc folder, then take the functions.php file and upload just that file to (where) the web server under my website on the web? Would that work so that I don't lose all of the work (plugins, pages, post, etc.)?

  6. esmi
    Forum Moderator
    Posted 2 years ago #

    You won't lose any content or plugins by re-uploading the theme.

  7. jaydokie
    Member
    Posted 2 years ago #

    Worked. One problem. I have columns on http://roundhousetalk.com (homepage) and the columns language inserts appears correctly when I pull up the page in the editor, but when I go to the homepage on the web, it's not in columns. I used Column-Matic plugin which I deactivated and the activated and still no change. Any suggestions?

  8. jaydokie
    Member
    Posted 2 years ago #

    You can close this as I have someone else working on restoration of the columns as an issue by itself. Thanks very much for your help. Relieved me greatly!

Topic Closed

This topic has been closed to new replies.

About this Topic