* add_action( 'after_setup_theme', 'my_child_theme_setup' ); * function my_child_theme_setup() { * * remove_filter('filter_hook', 'callback_function' ); * ... * } * * * For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API. * * @package WordPress * @subpackage Graphene * @since Graphene 1.0 */ /** * Retrieve the theme's user settings and default settings. Individual files can access * these setting via a global variable call, so database query is only * done once. * */ include('admin/options-defaults.php'); $graphene_settings = get_option('graphene_settings'); /** * If there is no theme settings in the database yet (e.g. first install), add the database entry. */ if (!function_exists('graphene_db_init')) : function graphene_db_init(){ global $graphene_settings, $graphene_defaults; /* Run DB updater if $graphene_settings does not exist in db */ if (!$graphene_settings){ // For first install if (get_option('graphene_ga_code') === false) { update_option('graphene_settings', $graphene_defaults); $graphene_settings = $graphene_defaults; } else { // For updates include('admin/db-updater.php'); graphene_update_db(); $graphene_settings = get_option('graphene_settings'); } /* $graphene_settings exists, but new options has been added since previous version */ } elseif (count($graphene_settings) != count($graphene_defaults)) { $initial_settings = array(); // Construct the updated settings foreach ($graphene_defaults as $option => $value) : $updated_settings[$option] = (array_key_exists($option, $graphene_settings)) ? $graphene_settings[$option] : $value; endforeach; // Add the initial settings to the database update_option('graphene_settings', $updated_settings); // Update the global $graphene_settings; $graphene_settings = $updated_settings; } } endif; add_action('init', 'graphene_db_init'); /** * Set the content width based on the theme's design and stylesheet. * * Used to set the width of images and content. Should be equal to the width the theme * is designed for, generally via the style.css stylesheet. */ if (!isset($content_width)){ $column_mode = graphene_column_mode(); if (strpos($graphene_settings['post_date_display'], 'icon') === 0){ if (strpos($column_mode, 'two-col') === 0){ $content_width = apply_filters('graphene_content_width_two_columns', 590); } else if (strpos($column_mode, 'three-col-center') === 0) { $content_width = apply_filters('graphene_content_width_three_columns_center', 360); } else if (strpos($column_mode, 'three-col') === 0){ $content_width = apply_filters('graphene_content_width_three_columns', 375); } else { $content_width = apply_filters('graphene_content_width_one_columns', 875); } } else { if (strpos($column_mode, 'two-col') === 0){ $content_width = apply_filters('graphene_content_width_two_columns_nodate', 645); } else if (strpos($column_mode, 'three-col-center') === 0) { $content_width = apply_filters('graphene_content_width_three_columns_center_nodate', 415); } else if (strpos($column_mode, 'three-col') === 0){ $content_width = apply_filters('graphene_content_width_three_columns_nodate', 430); } else { $content_width = apply_filters('graphene_content_width_one_columns_nodate', 930); } } } /** Tell WordPress to run graphene_setup() when the 'after_setup_theme' hook is run. */ add_action('after_setup_theme', 'graphene_setup' ); if (!function_exists( 'graphene_setup')): /** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which runs * before the init hook. The init hook is too late for some features, such as indicating * support post thumbnails. * * To override graphene_setup() in a child theme, add your own graphene_setup to your child theme's * functions.php file. * * @uses add_theme_support() To add support for post thumbnails and automatic feed links. * @uses register_nav_menus() To add support for navigation menus. * @uses add_custom_background() To add support for a custom background. * @uses load_theme_textdomain() For translation/localization support. * @uses add_custom_image_header() To add support for a custom header. * @uses register_default_headers() To register the default custom header images provided with the theme. * @uses set_post_thumbnail_size() To set a custom post thumbnail size. * * @since Graphene 1.0 */ function graphene_setup() { global $graphene_settings; // Define the theme's database version define('GRAPHENE_DBVERSION', 1.0); // Add the theme's dbversion in the database if none exist if (!get_option('graphene_dbversion')) {update_option('graphene_dbversion', GRAPHENE_DBVERSION);} // Add custom image sizes $height = ($graphene_settings['slider_height']) ? $graphene_settings['slider_height'] : 240; add_image_size('graphene_slider', apply_filters('graphene_slider_image_width', 660), $height, true); add_image_size('graphene_slider_full', apply_filters('graphene_slider_full_image_width', 930), $height, true); add_image_size('graphene_slider_small', apply_filters('graphene_slider_small_image_width', 445), $height, true); // Add support for editor syling add_editor_style(); // Add default posts and comments RSS feed links to head add_theme_support( 'automatic-feed-links' ); // This theme uses post thumbnails add_theme_support( 'post-thumbnails' ); // Make theme available for translation // Translations can be filed in the /languages/ directory load_theme_textdomain( 'graphene', get_template_directory().'/languages' ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'Header Menu' => __('Header Menu', 'graphene'), 'secondary-menu' => __('Secondary Menu', 'graphene'), ) ); // This theme allows users to set a custom background add_custom_background(); // Your changeable header business starts here define('HEADER_TEXTCOLOR', apply_filters('graphene_header_textcolor', '000000')); // No CSS, just IMG call. The %s is a placeholder for the theme template directory URI. define('HEADER_IMAGE', apply_filters('graphene_header_image', '%s/images/headers/flow.jpg')); // The height and width of your custom header. You can hook into the theme's own filters to change these values. // Add a filter to graphene_header_image_width and graphene_header_image_height to change these values. define('HEADER_IMAGE_WIDTH', apply_filters('graphene_header_image_width', 960)); define('HEADER_IMAGE_HEIGHT', apply_filters('graphene_header_image_height', 198)); // We'll be using post thumbnails for custom header images on posts and pages. // We want them to be 940 pixels wide by 198 pixels tall. // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. set_post_thumbnail_size(HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true); // Don't support text inside the header image. define('NO_HEADER_TEXT', apply_filters('graphene_header_text', false)); // Add a way for the custom header to be styled in the admin panel that controls // custom headers. See graphene_admin_header_style(), below. add_custom_image_header('', 'graphene_admin_header_style'); // ... and thus ends the changeable header business. // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. register_default_headers( graphene_get_default_headers() ); do_action('graphene_setup'); } endif; function graphene_get_default_headers() { return array( 'Schematic' => array( 'url' => '%s/images/headers/schematic.jpg', 'thumbnail_url' => '%s/images/headers/schematic-thumb.jpg', /* translators: header image description */ 'description' => __('Header image by Syahir Hakim', 'graphene') ), 'Flow' => array( 'url' => '%s/images/headers/flow.jpg', 'thumbnail_url' => '%s/images/headers/flow-thumb.jpg', /* translators: header image description */ 'description' => __('This is the default Graphene theme header image, cropped from image by Quantin Houyoux at sxc.hu', 'graphene') ), 'Fluid' => array( 'url' => '%s/images/headers/fluid.jpg', 'thumbnail_url' => '%s/images/headers/fluid-thumb.jpg', /* translators: header image description */ 'description' => __('Header image cropped from image by Ilco at sxc.hu', 'graphene') ), 'Techno' => array( 'url' => '%s/images/headers/techno.jpg', 'thumbnail_url' => '%s/images/headers/techno-thumb.jpg', /* translators: header image description */ 'description' => __('Header image cropped from image by Ilco at sxc.hu', 'graphene') ), 'Fireworks' => array( 'url' => '%s/images/headers/fireworks.jpg', 'thumbnail_url' => '%s/images/headers/fireworks-thumb.jpg', /* translators: header image description */ 'description' => __('Header image cropped from image by Ilco at sxc.hu', 'graphene') ), 'Nebula' => array( 'url' => '%s/images/headers/nebula.jpg', 'thumbnail_url' => '%s/images/headers/nebula-thumb.jpg', /* translators: header image description */ 'description' => __('Header image cropped from image by Ilco at sxc.hu', 'graphene') ), 'Sparkle' => array( 'url' => '%s/images/headers/sparkle.jpg', 'thumbnail_url' => '%s/images/headers/sparkle-thumb.jpg', /* translators: header image description */ 'description' => __('Header image cropped from image by Ilco at sxc.hu', 'graphene') ), ); } /** * Register and print the main theme stylesheet */ function graphene_main_stylesheet(){ wp_register_style('graphene-stylesheet', get_stylesheet_uri(), array(), false, 'screen'); wp_enqueue_style('graphene-stylesheet'); } add_action('wp_print_styles', 'graphene_main_stylesheet'); if (!function_exists('graphene_admin_header_style')) : /** * Styles the header image displayed on the Appearance > Header admin panel. * * Referenced via add_custom_image_header() in graphene_setup(). * * @since graphene 1.0 */ function graphene_admin_header_style(){ ?>
  • > comment_ID, $args);} ?>
    comment_approved == '0') : ?>

    '; echo stripslashes($graphene_settings['addthis_code']); echo ''; do_action('graphene_show_addthis'); } do_action('graphene_addthis'); } endif; /** * Register widgetized areas * * To override graphene_widgets_init() in a child theme, remove the action hook and add your own * function tied to the init hook. * * @since Graphene 1.0 * @uses register_sidebar */ function graphene_widgets_init() { if (function_exists('register_sidebar')) { global $graphene_settings; register_sidebar(array( 'name' => __('Sidebar Widget Area', 'graphene'), 'id' => 'sidebar-widget-area', 'description' => __( 'The first sidebar widget area (available in two and three column layouts).', 'graphene' ), 'before_widget' => '', 'before_title' => "

    ", 'after_title' => "

    ", )); register_sidebar(array( 'name' => __('Sidebar Two Widget Area', 'graphene'), 'id' => 'sidebar-two-widget-area', 'description' => __( 'The second sidebar widget area (only available in three column layouts).', 'graphene'), 'before_widget' => '', 'before_title' => "

    ", 'after_title' => "

    ", )); register_sidebar(array( 'name' => __('Footer Widget Area', 'graphene'), 'id' => 'footer-widget-area', 'description' => __( "The footer widget area. Leave empty to disable. Set the number of columns to display at the theme's Display Options page.", 'graphene' ), 'before_widget' => '', 'before_title' => "

    ", 'after_title' => "

    ", )); /** * Register alternate widget areas to be displayed on the front page, if enabled * * @package WordPress * @subpackage Graphene * @since Graphene 1.0.8 */ if ($graphene_settings['alt_home_sidebar']) { register_sidebar(array( 'name' => __('Front Page Sidebar Widget Area', 'graphene'), 'id' => 'home-sidebar-widget-area', 'description' => __( 'The first sidebar widget area that will only be displayed on the front page.', 'graphene' ), 'before_widget' => '', 'before_title' => "

    ", 'after_title' => "

    ", )); register_sidebar(array( 'name' => __('Front Page Sidebar Two Widget Area', 'graphene'), 'id' => 'home-sidebar-two-widget-area', 'description' => __( 'The second sidebar widget area that will only be displayed on the front page.', 'graphene' ), 'before_widget' => '', 'before_title' => "

    ", 'after_title' => "

    ", )); } if ($graphene_settings['alt_home_footerwidget']) { register_sidebar(array( 'name' => __('Front Page Footer Widget Area', 'graphene'), 'id' => 'home-footer-widget-area', 'description' => __( "The footer widget area that will only be displayed on the front page. Leave empty to disable. Set the number of columns to display at the theme's Display Options page.", 'graphene' ), 'before_widget' => '', 'before_title' => "

    ", 'after_title' => "

    ", )); } /* Header widget area */ if ($graphene_settings['enable_header_widget']) : register_sidebar(array( 'name' => __('Header Widget Area', 'graphene'), 'id' => 'header-widget-area', 'description' => __("The header widget area.", 'graphene'), 'before_widget' => '', 'before_title' => "

    ", 'after_title' => "

    ", )); endif; } do_action('graphene_widgets_init'); } /** Register sidebars by running graphene_widgets_init() on the widgets_init hook. */ add_action('widgets_init', 'graphene_widgets_init'); /** * Register custom Twitter widgets. */ global $twitter_username; global $twitter_tweetcount; $twitter_username = ''; $twitter_tweetcount = 1; class Graphene_Widget_Twitter extends WP_Widget{ function Graphene_Widget_Twitter(){ // Widget settings $widget_ops = array('classname' => 'Graphene_Twitter', 'description' => __('Display the latest Twitter status updates.', 'graphene')); // Widget control settings $control_ops = array('id_base' => 'graphene-twitter'); // Create the widget $this->WP_Widget('graphene-twitter', 'Graphene Twitter', $widget_ops, $control_ops); } function widget($args, $instance){ // This function displays the widget extract($args); // User selected settings global $twitter_username; global $twitter_tweetcount; $twitter_title = $instance['twitter_title']; $twitter_username = $instance['twitter_username']; $twitter_tweetcount = $instance['twitter_tweetcount']; echo $args['before_widget'].$args['before_title'].$twitter_title.$args['after_title']; ?> '; } // graphene_add_twitter_script(); add_action('wp_footer', 'graphene_add_twitter_script'); } function update($new_instance, $old_instance){ // This function processes and updates the settings $instance = $old_instance; // Strip tags (if needed) and update the widget settings $instance['twitter_username'] = strip_tags($new_instance['twitter_username']); $instance['twitter_tweetcount'] = strip_tags($new_instance['twitter_tweetcount']); $instance['twitter_title'] = strip_tags($new_instance['twitter_title']); return $instance; } function form($instance){ // This function sets up the settings form // Set up default widget settings $defaults = array( 'twitter_username' => 'username', 'twitter_tweetcount' => 5, 'twitter_title' => __('Latest tweets', 'graphene'), ); $instance = wp_parse_args( (array) $instance, $defaults ); ?>

    'General')){ $links = array(); foreach( $tabs as $tab => $name) : if ( $tab == $current ) : $links[] = "$name"; else : $links[] = "$name"; endif; endforeach; echo '

    '; foreach ($links as $link) echo $link; echo '

    '; } endif; /** * Include the file for additional user fields * * @package WordPress * @subpackage Graphene * @since Graphene 1.1 */ include('admin/user.php'); /** * Include the file for additional custom fields in posts and pages editing screens * * @package WordPress * @subpackage Graphene * @since Graphene 1.1 */ include('admin/custom-fields.php'); /** * Customise the comment form */ // Starting with the default fields function graphene_comment_form_fields(){ $fields = array( 'author' => '

    ', 'email' => '

    ', 'url' => '

    ', ); do_action('graphene_comment_form_fields'); return $fields; } // The comment field textarea function graphene_comment_textarea(){ echo '

    '; do_action('graphene_comment_textarea'); } // The submit button function graphene_comment_submit_button(){ echo '

    '; do_action('graphene_comment_submit_button'); } // Add all the filters we defined add_filter('comment_form_default_fields', 'graphene_comment_form_fields'); add_filter('comment_form_field_comment', 'graphene_comment_textarea'); add_filter('comment_form', 'graphene_comment_submit_button'); /** * Returns a "Continue Reading" link for excerpts * Based on the function from the Twenty Ten theme * * @since Graphene 1.0.8 * @return string "Continue Reading" link */ if (!function_exists('graphene_continue_reading_link')) : function graphene_continue_reading_link() { if (!is_page()) { $more_link_text = __('Continue reading »', 'graphene'); return '

    '.$more_link_text.''; } } endif; /** * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and graphene_continue_reading_link(). * Based on the function from Twenty Ten theme. * * To override this in a child theme, remove the filter and add your own * function tied to the excerpt_more filter hook. * * @since Graphene 1.0.8 * @return string An ellipsis */ function graphene_auto_excerpt_more($more) { return apply_filters('graphene_auto_excerpt_more', ' … '.graphene_continue_reading_link()); } add_filter('excerpt_more', 'graphene_auto_excerpt_more' ); /** * Add the Read More link to manual excerpts * * @since Graphene 1.1.3 */ function graphene_manual_except_more($text){ if (has_excerpt()){ $text = explode('

    ', $text); $text[count($text)-2] .= graphene_auto_excerpt_more(''); $text = implode('

    ', $text); } return $text; } if ($graphene_settings['show_excerpt_more']) { add_filter('the_excerpt', 'graphene_manual_except_more'); } /** * Generates the posts navigation links */ if (!function_exists('graphene_posts_nav')) : function graphene_posts_nav(){ ?>

    tag of the the slider image. * * It requires the post's ID to be passed in as argument so that the user settings in * individual post / page can be retrieved. */ if (!function_exists('graphene_get_slider_image')) : function graphene_get_slider_image($post_id = NULL, $size = 'thumbnail', $urlonly = false){ global $graphene_settings; // Throw an error message if no post ID supplied if ($post_id == NULL){ echo 'ERROR: Post ID must be passed as an input argument to call the function graphene_get_slider_image().'; return; } // First get the settings $global_setting = ($graphene_settings['slider_img']) ? $graphene_settings['slider_img'] : 'featured_image'; $local_setting = (get_post_meta($post_id, '_graphene_slider_img', true)) ? get_post_meta($post_id, '_graphene_slider_img', true) : 'global'; // Determine which image should be displayed $final_setting = ($local_setting == 'global') ? $global_setting : $local_setting; // Build the html based on the final setting $html = ''; if ($final_setting == 'disabled'){ // image disabled return; } elseif ($final_setting == 'featured_image'){ // Featured Image if (has_post_thumbnail($post_id)) : if ($urlonly) $html = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), $size); else $html .= get_the_post_thumbnail($post_id, $size); /* Disabling the default image. Seems like it's more trouble than worth it elseif (!$urlonly) : $html .= apply_filters('graphene_generic_slider_img', ''); else : $html .= apply_filters('graphene_generic_slider_img', get_template_directory_uri().'/images/img_slider_generic.png'); */ endif; } elseif ($final_setting == 'post_image'){ // First image in post $html = graphene_get_post_image($post_id, $size, '', $urlonly); } elseif ($final_setting == 'custom_url'){ // Custom URL if (!$urlonly){ $html .= ''; if ($local_setting != 'global') : $html .= ''; else : $html .= ''; endif; $html .= ''; } else { if ($local_setting != 'global') : $html .= get_post_meta($post_id, '_graphene_slider_imgurl', true); else : $html .= $graphene_settings['slider_imgurl']; endif; } } // Returns the html return $html; } endif; /** * This function gets the first image (as ordered in the post's media gallery) attached to * the current post. It outputs the complete tag, with height and width attributes. * The function returns the thumbnail of the original image, linked to the post's * permalink. Returns FALSE if the current post has no image. * * This function requires the post ID to get the image from to be supplied as the * argument. If no post ID is supplied, it outputs an error message. An optional argument * size can be used to determine the size of the image to be used. * * Based on code snippets by John Crenshaw * (http://www.rlmseo.com/blog/get-images-attached-to-post/) * * @package WordPress * @subpackage Graphene * @since Graphene 1.1 */ if (!function_exists('graphene_get_post_image')) : function graphene_get_post_image($post_id = NULL, $size = 'thumbnail', $context = '', $urlonly = false){ /* Display error message if no post ID is supplied */ if ($post_id == NULL){ _e('ERROR: You must supply the post ID to get the image from as an argument when calling the graphene_get_post_image() function.', 'graphene'); return; } /* Get the images */ $images = get_children(array( 'post_type' => 'attachment', 'post_mime_type' => 'image', 'post_parent' => $post_id, 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 1, ), ARRAY_A); $html = ''; /* Returns FALSE if there is no image */ if (empty($images) && $context != 'excerpt' && !$urlonly) { $html .= apply_filters('graphene_generic_slider_img', ''); } /* Build the tag if there is an image */ foreach ($images as $image){ if (!$urlonly) { if ($context == 'excerpt') {$html .= '
    ';}; $html .= ''; $html .= wp_get_attachment_image($image['ID'], $size); $html .= ''; if ($context == 'excerpt') {$html .= '
    ';}; } else { $html = wp_get_attachment_image_src($image['ID'], $size); } } /* Returns the image HTMl */ return $html; } endif; /** * This function retrieves the header image for the theme */ if (!function_exists('graphene_get_header_image')) : function graphene_get_header_image($post_id = NULL){ global $graphene_settings; if ( is_singular() && has_post_thumbnail( $post_id ) && ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), 'post-thumbnail' ) ) && $image[1] >= HEADER_IMAGE_WIDTH && !$graphene_settings['featured_img_header']) { // Houston, we have a new header image! // Gets only the image url. It's a pain, I know! Wish Wordpress has better options on this one $header_img = get_the_post_thumbnail( $post_id, 'post-thumbnail' ); $header_img = explode('" class="', $header_img); $header_img = $header_img[0]; $header_img = explode('src="', $header_img); $header_img = $header_img[1]; // only the url } else if ($graphene_settings['use_random_header_img']){ $default_header_images = graphene_get_default_headers(); $randomkey = array_rand($default_header_images); $header_img = str_replace('%s', get_template_directory_uri(), $default_header_images[$randomkey]['url']); } else { $header_img = get_header_image(); } return $header_img; } add_action('graphene_get_header_image', 'graphene_get_header_image'); endif; /** * Adds the functionality to count comments by type, eg. comments, pingbacks, tracbacks. * Based on the code at WPCanyon (http://wpcanyon.com/tipsandtricks/get-separate-count-for-comments-trackbacks-and-pingbacks-in-wordpress/) * * @package WordPress * @subpackage Graphene * @since Graphene 1.1.3 */ function graphene_comment_count($type = 'comments', $noneText = '', $oneText = '', $moreText = ''){ if($type == 'comments') : $typeSql = 'comment_type = ""'; elseif($type == 'pings') : $typeSql = 'comment_type != ""'; elseif($type == 'trackbacks') : $typeSql = 'comment_type = "trackback"'; elseif($type == 'pingbacks') : $typeSql = 'comment_type = "pingback"'; endif; global $wpdb; $result = $wpdb->get_var(' SELECT COUNT(comment_ID) FROM '.$wpdb->comments.' WHERE '.$typeSql.' AND comment_approved="1" AND comment_post_ID= '.get_the_ID() ); if($result == 0): echo str_replace('%', $result, $noneText); elseif($result == 1): echo str_replace('%', $result, $oneText); elseif($result > 1): echo str_replace('%', $result, $moreText); endif; } /** * Enqueue the jQuery Tools Tabs JS and the necessary script for comments/pings tabs */ function graphene_tabs_js(){ ?> element. The additional classes * are added by filtering the Wordpress body_class() function. */ function graphene_body_class($classes){ $column_mode = graphene_column_mode(); $classes[] = $column_mode; // for easier CSS if ( strpos($column_mode, 'two-col') === 0){ $classes[] = 'two-columns'; } else if ( strpos($column_mode, 'three-col') === 0 ){ $classes[] = 'three-columns'; } // Prints the body class return $classes; } add_filter('body_class', 'graphene_body_class'); /** * This functions adds additional classes to the post element. The additional classes * are added by filtering the WordPress post_class() function. */ function graphene_post_class($classes){ global $graphene_settings; if (in_array($graphene_settings['post_date_display'], array('hidden', 'text'))) { $classes[] = 'nodate'; } // Prints the body class return $classes; } add_filter('post_class', 'graphene_post_class'); function graphene_column_mode(){ global $graphene_settings; // first check the template if (is_page_template('template-onecolumn.php')) return 'one-column'; elseif (is_page_template('template-twocolumnsleft.php')) return 'two-col-left'; elseif (is_page_template('template-twocolumnsright.php')) return 'two-col-right'; elseif (is_page_template('template-threecolumnsleft.php')) return 'three-col-left'; elseif (is_page_template('template-threecolumnsright.php')) return 'three-col-right'; elseif (is_page_template('template-threecolumnscenter.php')) return 'three-col-center'; else // now get the column mode return $graphene_settings['column_mode']; } /** * Add the .htc file for partial CSS3 support in Internet Explorer */ function graphene_ie_css3(){ ?> ID, '_menu_item_object_id', true); //get first menu item that is a child of that object $children = $wpdb->get_var('SELECT post_id FROM '.$wpdb->postmeta.' WHERE meta_key like "_menu_item_menu_item_parent" AND meta_value='.$item->ID.' LIMIT 1'); //if there is at least one item, then $children variable will contain it's ID (which is of course more than 0) if($children > 0) //in that case - add the CSS class $classlist[] = 'menu-item-ancestor'; //return class list return $classlist; } //add filter to nav_menu_css_class list add_filter('nav_menu_css_class', 'graphene_add_ancestor_class', 2, 10); /** * Prints out the content of a variable wrapped in
     elements.
     * For development and debugging use
    */
    function disect_it($var = NULL, $exit = true, $comment = false){
    	if ($var !== NULL){
    		if ($comment) {echo '';}
    		if ($exit) {exit();}
    	} else {
    		echo 'ERROR: You must pass a variable as argument to the disect_it() function.';	
    	}
    }
    ?>