PHP错误,意外结束。 Functions.php文件

时间:2013-01-09 04:25:12

标签: php html function

我不断收到某种语法错误。它说:

  

[09-Jan-2013 04:17:17 UTC] PHP Parse错误:语法错误,意外','在第730行的functions.php

我删除了','然后我又收到另一个错误,其中包含意外的')',然后是意外的';)以及最后意外的'$ end'

任何人都知道我在做什么?

/*----------------------------------------/
            POST LIST THUMBS
/----------------------------------------*/
if ( !function_exists('fb_AddThumbColumn') && function_exists('add_theme_support') ) {

    function fb_AddThumbColumn($cols) {
        $cols['thumbnail'] = __('Thumbnail');
        return $cols;
    }
    function fb_AddThumbValue($column_name, $post_id) {
        $width = (int) 45;
        $height = (int) 45;
        if ( 'thumbnail' == $column_name ) {
            // thumbnail of WP 2.9
            $thumbnail_id = get_post_meta( $post_id, '_thumbnail_id', true );
            // image from gallery
            $attachments = get_children( array('post_parent' => $post_id, 'post_type' => 'attachment', 'post_mime_type' => 'image') );
            if ($thumbnail_id)
                $thumb = wp_get_attachment_image( $thumbnail_id, array($width, $height), true );
            elseif ($attachments) {
                foreach ( $attachments as $attachment_id => $attachment ) {
                    $thumb = wp_get_attachment_image( $attachment_id, array($width, $height), true );
                }
            }
            if ( isset($thumb) && $thumb ) {
                echo $thumb;
            } else {
                echo __('None');
            }
        }
    }
    // for posts
    add_filter( 'manage_posts_columns', 'fb_AddThumbColumn' );
    add_action( 'manage_posts_custom_column', 'fb_AddThumbValue', 10, 2 );
    // for pages
    //add_filter( 'manage_pages_columns', 'fb_AddThumbColumn' );
    //add_action( 'manage_pages_custom_column', 'fb_AddThumbValue', 10, 2 );
}, get_stylesheet_directory_uri() . );


//------ SIDEBARS ------//
//require_once(LN_FRAMEWORK .

4 个答案:

答案 0 :(得分:0)

你可能在某个地方遗漏了}。确保您使用的是带语法高亮和括号匹配的代码编辑器,并使用它来检查括号。

答案 1 :(得分:0)

// ------ SIDEBARS ------ //

您遗漏的代码中的

require_once(LN_FRAMEWORK) )。 (和)< - 他们需要匹配

答案 2 :(得分:0)

require_once(LN_FRAMEWORK . 

应该是

require_once(LN_FRAMEWORK);

答案 3 :(得分:0)

你的问题在于这一行:

}, get_stylesheet_directory_uri() . );

整条线都错了。在几个方面。看起来这是一大堆代码被偶然粘贴到错误的地方。

你知道它应该做什么吗?如果没有,请删除整行,然后将}留在那里。