解析错误:语法错误,文件wordpress主题意外结束 - javascript

错误:解析错误:语法错误,/Applications/MAMP/htdocs/volcano/wp-content/themes/volcano_1.01/inc/function-admin.php中第144行上的文件意外结束我一直在使用WordPress主题。我目前在工作
管理面板。我在MAMP服务器上的测试环境中使用它。我做错事情了。如果有人可以查看一下,那将非常有帮助。谢谢!

<?php

/*

@package volcanotheme

    ========================
        ADMIN PAGE
    ========================
*/

function volcano_add_admin_page() {

    //Generate Volcano Admin Page
    add_menu_page( 'Volcano Theme Options', 'volcano', 'manage_options', 'testernick_volcano', 'volcano_theme_create_page', get_template_directory_uri() . '/img/screenshot.png', 110 );

    //Generate Volcano Admin Sub Pages
    add_submenu_page( 'testernick_volcano', 'Volcano Sidebar Options', 'Sidebar', 'manage_options', 'testernick_volcano', 'volcano_theme_create_page' );
    add_submenu_page( 'testernick_volcano', 'Volcano Theme Options', 'Theme Options', 'manage_options', 'testernick_volcano_theme', 'volcano_theme_support_page' );
    add_submenu_page( 'testernick_volcano', 'Volcano CSS Options', 'Custom CSS', 'manage_options', 'testernick_volcano_css', 'volcano_theme_settings_page');

}
add_action( 'admin_menu', 'volcano_add_admin_page' );

//Activate custom settings
add_action( 'admin_init', 'volcano_custom_settings' );

function volcano_custom_settings() {
    //Sidebar Options
    register_setting( 'volcano-settings-group', 'profile_picture' );
    register_setting( 'volcano-settings-group', 'first_name' );
    register_setting( 'volcano-settings-group', 'last_name' );
    register_setting( 'volcano-settings-group', 'user_description' );
    register_setting( 'volcano-settings-group', 'twitter_handler', 'volcano_sanitize_twitter_handler' );
    register_setting( 'volcano-settings-group', 'facebook_handler' );
    register_setting( 'volcano-settings-group', 'gplus_handler' );

    add_settings_section( 'volcano-sidebar-options', 'Sidebar Option', 'volcano_sidebar_options', 'testernick_volcano');

    add_settings_field( 'sidebar-profile-picture', 'Profile Picture', 'volcano_sidebar_profile', 'testernick_volcano', 'volcano-sidebar-options');
    add_settings_field( 'sidebar-name', 'Full Name', 'volcano_sidebar_name', 'testernick_volcano', 'volcano-sidebar-options');
    add_settings_field( 'sidebar-description', 'Description', 'volcano_sidebar_description', 'testernick_volcano', 'volcano-sidebar-options');
    add_settings_field( 'sidebar-twitter', 'Twitter handler', 'volcano_sidebar_twitter', 'testernick_volcano', 'volcano-sidebar-options');
    add_settings_field( 'sidebar-facebook', 'Facebook handler', 'volcano_sidebar_facebook', 'testernick_volcano', 'volcano-sidebar-options');
    add_settings_field( 'sidebar-gplus', 'Google+ handler', 'volcano_sidebar_gplus', 'testernick_volcano', 'volcano-sidebar-options');

    //Theme Support Options
    register_setting( 'volcano-theme-support', 'post_formats' );
    register_setting( 'volcano-theme-support', 'custom_header' );
    register_setting( 'volcano-theme-support', 'custom_background' );

    add_settings_section( 'volcano-theme-options', 'Theme Options', 'volcano_theme_options', 'testernick_volcano_theme' );

    add_settings_field( 'post-formats', 'Post Formats', 'volcano_post_formats', 'testernick_volcano_theme', 'volcano-theme-options' );
    add_settings_field( 'custom-header', 'Custom Header', 'volcano_custom_header', 'testernick_volcano_theme', 'volcano-theme-options' );
    add_settings_field( 'custom-background', 'Custom Background', 'volcano_custom_background', 'testernick_volcano_theme', 'volcano-theme-options' );
}


function volcano_theme_options() {
    echo 'Activate and Deactivate specific Theme Support Options';


function volcano_post_formats() {
    $options = get_option( 'post_formats' );
    $formats = array( 'aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat' );
    $output = '';
    foreach ( $formats as $format ){
        $checked = ( @$options[$format] == 1 ? 'checked' : '' );
        $output .= '<label><input type="checkbox" id="'.$format.'" name="post_formats['.$format.']" value="1" '.$checked.' /> '.$format.'</label><br>';
    }
    echo $output;
}

function volcano_custom_header() {
    $options = get_option( 'custom_header' );
    $checked = ( @$options == 1 ? 'checked' : '' );
    echo '<label><input type="checkbox" id="custom_header" name="custom_header" value="1" '.$checked.' /> Activate the Custom Header</label>';
}

function volcano_custom_background() {
    $options = get_option( 'custom_background' );
    $checked = ( @$options == 1 ? 'checked' : '' );
    echo '<label><input type="checkbox" id="custom_background" name="custom_background" value="1" '.$checked.' /> Activate the Custom Background</label>';
}

// Sidebar Options Functions
function volcano_sidebar_options() {
    echo 'Customize your Sidebar Information';
}

function volcano_sidebar_profile() {
    $picture = esc_attr( get_option( 'profile_picture' ) );
    if( empty($picture) ){
        echo '<input type="button" class="button button-secondary" value="Upload Profile Picture" id="upload-button"><input type="hidden" id="profile-picture" name="profile_picture" value="" />';
    } else {
        echo '<input type="button" class="button button-secondary" value="Replace Profile Picture" id="upload-button"><input type="hidden" id="profile-picture" name="profile_picture" value="'.$picture.'" /> <input type="button" class="button button-secondary" value="Remove" id="remove-picture">';
    }

}
function volcano_sidebar_name() {
    $firstName = esc_attr( get_option( 'first_name' ) );
    $lastName = esc_attr( get_option( 'last_name' ) );
    echo '<input type="text" name="first_name" value="'.$firstName.'" placeholder="First Name" /> <input type="text" name="last_name" value="'.$lastName.'" placeholder="Last Name" />';
}
function volcano_sidebar_description() {
    $description = esc_attr( get_option( 'user_description' ) );
echo '<input type="text" name="user_description" value="'.$description.'" placeholder="Description" /><p class="description">Write something smart.</p>';
}
function volcano_sidebar_twitter() {
    $twitter = esc_attr( get_option( 'twitter_handler' ) );
    echo '<input type="text" name="twitter_handler" value="'.$twitter.'" placeholder="Twitter handler" /><p class="description">Input your Twitter username without the @ character.</p>';
}
function volcano_sidebar_facebook() {
    $facebook = esc_attr( get_option( 'facebook_handler' ) );
    echo '<input type="text" name="facebook_handler" value="'.$facebook.'" placeholder="Facebook handler" />';
}
function volcano_sidebar_gplus() {
    $gplus = esc_attr( get_option( 'gplus_handler' ) );
    echo '<input type="text" name="gplus_handler" value="'.$gplus.'" placeholder="Google+ handler" />';
}

//Sanitization settings
function volcano_sanitize_twitter_handler( $input ){
$output = sanitize_text_field( $input );
    $output = str_replace('@', '', $output);
    return $output;
}

//Template submenu functions
function volcano_theme_create_page() {
    require_once( get_template_directory() . '/inc/templates/volcano-admin.php' );
}

function volcano_theme_support_page() {
    require_once( get_template_directory() . '/inc/templates/volcano-theme-support.php' );
    }
    function volcano_theme_settings_page() {

        echo '<h1>volcano Custom CSS</h1>';

    }

    }

参考方案

函数}的大括号volcano_theme_options()右移到底部。检查并修复。

如何在没有for循环的情况下在Javascript中使用Django模板标签 - javascript

我想在JavaScript中使用模板变量:我的问题是在javascript代码中使用for循环,for循环之间的所有事情都会重复..但我不想要....下面粘贴了我的代码..有人可以告诉我更好的方法吗这..因为这看起来很丑..这是我的代码: {% block extra_javascript %} <script src="/static/js…

如果我得到url(''),我该如何使用另一个URL - javascript

我是新手,正在写这篇文章,但是如果源上没有图像,那么我只有空白。有人可以告诉我,如果我正在获取背景图像,如何获取/images/no-image.jpg:url();这是我的代码:<div class="uk-clearfix uk-position-relative"> <div class="recipeb…

在JavaScript函数中转义引号 - javascript

我正在尝试将变量传递给javascript函数。根据用户的选择,它可以是文本或图像。这里已经讨论了类似的问题,但我无法解决。在php中,我这样编码:if ($choice == 1) { $img = '<img src = "../folder/'.$_SESSION["img"].'�…

打印二维阵列 - javascript

我正在尝试打印子元素。在this example之后。怎么做?。$myarray = array("DO"=>array('IDEAS','BRANDS','CREATIVE','CAMPAIGNS'), "JOCKEY"=>a…

如何从php中获取datatables jQuery插件的json数据 - php

我是PHP的新手,正在尝试使用Datatables jQuery插件。我知道我必须从.php文件中获取数据,然后在数据表中使用它,但是我似乎无法通过ajax将其传递给数据表。我设法从数据库中获取数据,并对其进行json编码,但是后来我不知道如何在我的index.php文件中调用它,并在其中显示它。我究竟做错了什么?这是我的代码:HTML(已编辑): <…