• Parse error: syntax error, unexpected ‘my_theme_menu’ (T_STRING) in C:\xampp\htdocs\mazen\wp-content\themes\DEstiny\snippet\admin-menu.php on line 5

    
    
    <?php
    //create custom admin menu's
    // add the main menu
     add_action('admin_menu', 'my_theme_menu');
     function my_theme_menu(){
     
    // the settings
     
    $page_title = "My Themes Admin";
     
    $menu_title = "Theme Settings";
    /*
    * Please not that this changed in the latest wordpress
    * versions from a number to words for user capabilities.
    * This would of been 7 but now you should use 'administrator'.
    */
    $capability = 'administrator';
     
    $menu_slug = "theme-settings";
     
    $function = "main_theme_menu";
     
    $icon_url = ""; // could be anything jpg, png, gif
     
    $position = '5';
     
    add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ); // create the menu
     
    }
     
    wp_enqueue_script( 'jquery' );  //this code here  enables jquery
     
    // Here we add the jQuery UI script to our theme header
     
    wp_register_script( 'jquery-ui-script', get_bloginfo('template_url').'/snippet/js/jquery-ui-1.8.16.custom.min.js'); //this part registers the new script
     
    wp_enqueue_script( 'jquery-ui-script' ); //this part puts the script in to our page header
     
    // Here we add the jQuery UI theme Css to our header
    $myThemeStyleUrl = get_bloginfo('template_url') . '/snippet/css/ui-lightness/jquery-ui-1.8.16.custom.css'; //set the path to our css
     
    wp_enqueue_style('jquery-ui-style', $myThemeStyleUrl,'1.0','screen'); // this puts the css in the header
     
    // Here we add the code that enables the tabbed menu
    add_action('admin_head', 'enableTabMenu');
     
    function enableTabMenu(){
     
    echo "<script type="text/javascript">// <![CDATA[
     
    jQuery(function() {
     
    jQuery( '#tabs' ).tabs();
     
    });
     
    // ]]></script>";
     
    }
     
    function main_theme_menu() {
     
    ?>

    <div id=”tabs”>

    <div id=”tabs-1″>
    First Menu Content here…</div>
    <div id=”tabs-2″>
    Second Menu Content here…</div>
    <div id=”tabs-3″>
    Third Menu Content here…</div>
    </div>

    <?php
    }
    

    and how can i remove the hole tab section and start fields inside a div ?. full code .

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Hello again!

    You’ve come up with a strange one this time. There’s no syntax error in the first dozen lines you posted, whatever it is, it got lost in translation. There may be a non-printing character in your original file. Try deleting everything above the function definition and retyping the <?php and add_action line, without the comments, then be sure to save the file as UTF-8 without a byte order mark.

    As for removing tab sections, you’re just editing straight HTML, simply remove the part you do not want. There could be side effects of doing this though, such as javascript errors, so keep good backups of files before you try changing things.

Viewing 1 replies (of 1 total)
  • The topic ‘theme option showing syntax error’ is closed to new replies.