|
 |
Enjoy an ad free experience by logging in. Not a member yet? Register.
|
|
|
|
01-14-2012, 11:48 PM
|
PM User |
#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;
|
|
|
|
01-15-2012, 01:35 AM
|
PM User |
#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 01:39 AM..
|
|
|
01-15-2012, 01:50 AM
|
PM User |
#3
|
|
Supreme Master coder!

Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,292
Thanks: 2
Thanked 1,044 Times in 1,020 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!||||
|
|
|
 |
Jump To Top of Thread
| Thread Tools |
|
|
| Rate This Thread |
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +1. The time now is 01:24 PM.
|
Advertisement Log in to turn off these ads. |
|
|
|
|
|
|
|
|
|
|