Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

shihabmalayil on "theme option showing syntax error"

$
0
0

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 all articles
Browse latest Browse all 8245

Trending Articles