Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help Parse error: syntax error, unexpected '}' /functions.php on line 24

    Can't seem to figure out how to fix this? Any suggestions

    PHP Code:
    <?php

    require_once(TEMPLATEPATH '/dashboard.php'); 


    if ( 
    function_exists('register_sidebar') ) 

    register_sidebar(array('name' => 'Post Left','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>'));    
    register_sidebar(array('name' => 'Post Center','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>'));   
    register_sidebar(array('name' => 'Post Right','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>')); 
    register_sidebar(array('name' => 'Footer Left','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>'));
    register_sidebar(array('name' => 'Footer Center','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>'));
    register_sidebar(array('name' => 'Footer Right','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>'));
    }

    function 
    trim_excerpt($text) {
      return 
    rtrim($text,'[...]');
    }
    add_filter('get_the_excerpt''trim_excerpt');



    # Displays post image attachment (sizes: thumbnail, medium, full)
    function dp_attachment_image($postid=0$size='thumbnail'$attributes='') {
        if (
    $postid<1$postid get_the_ID();
        if (
    $images get_children(array(
            
    'post_parent' => $postid,
            
    'post_type' => 'attachment',
            
    'numberposts' => 1,
            
    'post_mime_type' => 'image',)))
            foreach(
    $images as $image) {
                
    $attachment=wp_get_attachment_image_src($image->ID$size);
                
    ?><img src="<?php echo $attachment[0]; ?><?php echo $attributes?> /><?php
            
    }
    }


    add_filter('comments_template''legacy_comments');
    function 
    legacy_comments($file) {
        if(!
    function_exists('wp_list_comments')) : // WP 2.7-only check
            
    $file TEMPLATEPATH '/legacy.comments.php';
        endif;
        return 
    $file;

  • #2
    Regular Coder
    Join Date
    Dec 2010
    Location
    Kent, UK
    Posts
    573
    Thanks
    23
    Thanked 10 Times in 10 Posts
    try this:

    PHP Code:
    <?php

    require_once(TEMPLATEPATH '/dashboard.php'); 


    if ( 
    function_exists('register_sidebar') ) 

    register_sidebar(array('name' => 'Post Left','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>'));    
    register_sidebar(array('name' => 'Post Center','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>'));   
    register_sidebar(array('name' => 'Post Right','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>')); 
    register_sidebar(array('name' => 'Footer Left','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>'));
    register_sidebar(array('name' => 'Footer Center','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>'));
    register_sidebar(array('name' => 'Footer Right','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>'));
    }

    function 
    trim_excerpt($text) {
      return 
    rtrim($text,'[...]');
    }
    add_filter('get_the_excerpt''trim_excerpt');



    # Displays post image attachment (sizes: thumbnail, medium, full)
    function dp_attachment_image($postid=0$size='thumbnail'$attributes='') {
        if (
    $postid<1$postid get_the_ID();
        if (
    $images get_children(array(
            
    'post_parent' => $postid,
            
    'post_type' => 'attachment',
            
    'numberposts' => 1,
            
    'post_mime_type' => 'image',)))
            foreach(
    $images as $image) {
                
    $attachment=wp_get_attachment_image_src($image->ID$size);
                <
    img src=/"$attachment[0]/" $attributes />
            }
    }


    add_filter('comments_template''legacy_comments');
    function 
    legacy_comments($file) {
        if(!
    function_exists('wp_list_comments')) : // WP 2.7-only check
            
    $file TEMPLATEPATH '/legacy.comments.php';
        endif;
        return 
    $file;
    Last edited by Dan13071992; 01-15-2012 at 02:39 AM.
    http://360-tactics.co.uk/forum/index.php

    Crime-Wave

    please post your code wrapped in tags
    please post your PHP wrapped in tags

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    What you have is almost fine. Where is the closing } for your legacy comments function.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •