• Resolved Iplish

    (@iplish)


    Hi Guys,

    I was just copying and pasting some code into my custom_functions.php, and went to delete exactly what I had just pasted in. I must have accidentally deleted a character somewhere, because now I get the above syntax error. I know absolutely nothing about php, can anyone point out what’s wrong? Here is the code, supposedly the error is on on line 26. I am using Thesis.

    <?php
    
    // Using hooks is absolutely the smartest, most bulletproof way to implement things like plugins,
    // custom design elements, and ads. You can add your hook calls below, and they should take the
    // following form:
    // add_action('thesis_hook_name', 'function_name');
    // The function you name above will run at the location of the specified hook. The example
    // hook below demonstrates how you can insert Thesis' default recent posts widget above
    // the content in Sidebar 1:
    // add_action('thesis_hook_before_sidebar_1', 'thesis_widget_recent_posts');
    // this is how to remove the comments hook
    
    remove_action('thesis_hook_after_post','thesis_comments_link');
    
    function full_width_nav() { ?>
    	<div id="nav_area" class="full_width">
    		<div class="page">
    			<?php thesis_nav_menu(); ?>
    		</div>
    	</div>
    <?php }
    
    remove_action('thesis_hook_before_header', 'thesis_nav_menu');
    add_action('thesis_hook_before_content_area', 'full_width_nav')
    
    function custom_bookmark_links() {
    	global $post;
    ?>
    <ul class="bookmark_links">
    	<li><a rel="nofollow" href="https://delicious.com/save?url=<?php urlencode(the_permalink()); ?>&title=<?php urlencode(the_title()); ?>" onclick="window.open('https://delicious.com/save?v=5&noui&jump=close&url=<?php urlencode(the_permalink()); ?>&title=<?php urlencode(the_title()); ?>', 'delicious', 'toolbar=no,width=550,height=550'); return false;" title="Bookmark this post on del.icio.us">Bookmark this article on Delicious</a></li>
    </ul>
    <?php }
    
    /**
     * function custom_bookmark_links() - outputs an HTML list of bookmarking links
     * NOTE: This only works when called from inside the WordPress loop!
     * SECOND NOTE: This is really just a sample function to show you how to use custom functions!
     *
     * @since 1.0
     * @global object $post
    */
Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator t-p

    (@t-p)

    try replacing your functions.php with a fresh copy

    Thread Starter Iplish

    (@iplish)

    I tried replacing the functions.php with a fresh copy. Same error. The line the error is supposedly on, 26, also stays the same even if I start moving code around. I tried replacing my customs_functions.php with a fresh copy, thinking I’d just start over with all my custom functions, and it still gave me the error. Not sure what to do.

    In above remove the two lines:

    <?php }

    The line:

    ?>

    The lines:

    /**
     * function custom_bookmark_links() - outputs an HTML list of bookmarking links
     * NOTE: This only works when called from inside the WordPress loop!
     * SECOND NOTE: This is really just a sample function to show you how to use custom functions!
     *
     * @since 1.0
     * @global object $post
    */

    and put this as the last line:

    ?>

    One more error(s)…

    function full_width_nav() { ?>

    should be

    function full_width_nav() {

    and the function ends with }

    Thread Starter Iplish

    (@iplish)

    worked, thanks!

    Moderator t-p

    (@t-p)

    you are welcome. ??

    This is, what I get when installing.
    The file is wp-config.php.
    I edited the wp-config-sample.php as directed.
    Inserted database details and copied the keys.
    I used the editor of Windows.
    But cannot identify the line 45 mentioned. Editor does not give line numbers.
    How can I go on from here?
    Thanks for any suggestion!

    MacBook Pro, Mac OS X, WordPress 3.4.1,

    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /homepages/15/d246579546/htdocs/georgeshomepage/wp-config.php on line 45

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘"Parse Error syntax error, unexpected T_IF…" for PHP newbie’ is closed to new replies.