dqpwdai095465 2013-09-19 12:11 采纳率: 100%
浏览 34
已采纳

在functions.php中出现意外的$ end

I'm getting the following error message about my functions.php file in Wordpress. Even after deleting the functions.php file, I'm still getting the same error!

Does anyone have any ideas what I can try to resolve this?

http://paintedonwater.com/wp

Edit:

The functions.php file code is pasted below. Note that I have REMOVED this file but I am still getting the same error.

    <?php

// add 'Music' post type

add_action( 'init', 'create_music_post_type' );
function create_music_post_type() {
    register_post_type( 'music',
        array(
            'labels' => array(
                'name' => __( 'Music' ),
                'add_new_item' => __( 'Add New Music Release' ),
                'singular_name' => __( 'Release' )
            ),
        'public' => true,
        'has_archive' => true,
        'menu_position' => 5, 
        'rewrite' => array('slug' => 'music'), 
        'supports' => array('title','editor','thumbnail')
        )
    );
}


// add 'Press' post type

add_action( 'init', 'create_press_post_type' );
function create_press_post_type() {
    register_post_type( 'press',
        array(
            'labels' => array(
                'name' => __( 'Press' ),
                'add_new_item' => __( 'Add New Press Feature' ),
                'singular_name' => __( 'Press' )
            ),
        'public' => true,
        'has_archive' => true,
        'menu_position' => 5, 
        'rewrite' => array('slug' => 'press'), 
        'supports' => array('title','editor','thumbnail')
        )
    );
}


// add 'Blog' post type

add_action( 'init', 'create_blog_post_type' );
function create_blog_post_type() {
    register_post_type( 'blog',
        array(
            'labels' => array(
                'name' => __( 'Blog' ),
                'add_new_item' => __( 'Add New Blog Post' ),
                'singular_name' => __( 'Blog' )
            ),
        'public' => true,
        'has_archive' => true,
        'menu_position' => 4, 
        'rewrite' => array('slug' => 'blog'), 
        'supports' => array('title','editor','thumbnail')
        )
    );
}

//Remove all Twenty Eleven Sidebars

add_action( 'after_setup_theme','remove_twentyeleven_all_widgets', 100 );
function remove_twentyeleven_all_widgets() {

remove_filter( 'widgets_init', 'twentyeleven_widgets_init' );
}


//Add Twitter widget area

function twitter_widgets_init() {

    register_sidebar( array(
        'name' => 'Twitter',
        'id' => 'twitter',
        'before_widget' => '<div>',
        'after_widget' => '</div>',
        'before_title' => '<h2>',
        'after_title' => '</h2>',
    ) );
}
add_action( 'widgets_init', 'twitter_widgets_init' );

//Add Album widget area

function album_widgets_init() {

    register_sidebar( array(
        'name' => 'New Album',
        'id' => 'new_album',
        'before_widget' => '<div>',
        'after_widget' => '</div>',
        'before_title' => '<h2>',
        'after_title' => '</h2>',
    ) );
}
add_action( 'widgets_init', 'album_widgets_init' );


//Add thumbnail sizes

add_theme_support( 'post-thumbnails', array( 'post','page' ) );
add_image_size('album-artwork', 166, 166, true);
add_image_size('gallerix-thumbnail', 175, 114, true);

//Add custom footer message

    function remove_footer_admin () {
    echo 'Fueled by love, music and <a href="http://www.wordpress.org" target="_blank">WordPress</a> | Designed by <a href="http://www.electrickiwi.co.uk" target="_blank">Electric Kiwi</a>';
    }

    add_filter('admin_footer_text', 'remove_footer_admin'); 

?>

UPDATE: All seems to be working now. I had to remove the functions.php file via the File Manager as somehow the FTP doesn't seem to be working correctly. After uploading via that, all seems to be ok. Thanks for everyone's answers.

  • 写回答

3条回答 默认 最新

  • dongren7374 2013-09-19 12:15
    关注

    Try

    • Add a closing PHP tag (?>) at the end of your file
    • Reupload your file to the server. Sometimes I get the same error as you and it does the trick. This could be caused by a ftp error.
    • And also check }

    at the end .

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记