__( 'Primary Navigation', 'starkers' ), ) ); } endif; function appglobe_jquery_enqueue() { if (is_admin()) return; global $wp_scripts; $cdn_script_in_footer = false; if (is_a($wp_scripts, 'WP_Scripts') && isset($wp_scripts->registered['jquery'])) { $registered_jquery_version = $wp_scripts -> registered[jquery] -> ver; if($registered_jquery_version) { $google_jquery_url = ($_SERVER['SERVER_PORT'] == 443 ? "https" : "http") . "://ajax.googleapis.com/ajax/libs/jquery/$registered_jquery_version/jquery.min.js"; if(200 === wp_remote_retrieve_response_code(wp_remote_head($google_jquery_url))) { wp_deregister_script('jquery'); wp_register_script('jquery', $google_jquery_url , false, null, $cdn_script_in_footer); } } } wp_enqueue_script('jquery'); wp_enqueue_style('jscrollpane', get_bloginfo('template_directory') . '/js/jScrollPane.css' ); wp_enqueue_script('jscrollpane', get_bloginfo('template_directory') . '/js/jScrollPane.js', array('jquery') ); wp_enqueue_script('jscroll', get_bloginfo('template_directory') . '/js/jScroll.js', array('jquery') ); wp_enqueue_script('wpa_script', get_bloginfo('template_directory') . '/js/wpascript.js', array('jquery') ); } add_action('wp_enqueue_scripts', 'appglobe_jquery_enqueue', 11); /** * Set our wp_nav_menu() fallback, starkers_menu(). * * @since Starkers HTML5 3.0 */ function starkers_menu() { echo ''; } /** * Remove inline styles printed when the gallery shortcode is used. * * @since Starkers HTML5 3.2 */ add_filter( 'use_default_gallery_style', '__return_false' ); /** * @since Starkers HTML5 3.0 * @deprecated in Starkers HTML5 3.2 for WordPress 3.1 * * @return string The gallery style filter, with the styles themselves removed. */ function starkers_remove_gallery_css( $css ) { return preg_replace( "##s", '', $css ); } // Backwards compatibility with WordPress 3.0. if ( version_compare( $GLOBALS['wp_version'], '3.1', '<' ) ) add_filter( 'gallery_style', 'starkers_remove_gallery_css' ); if ( ! function_exists( 'starkers_comment' ) ) : /** * Template for comments and pingbacks. * * @since Starkers HTML5 3.0 */ function starkers_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case '' : ?>
id="comment-"> comment_approved == '0' ) : ?>
$depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
id="comment-">

instead of . * * @since Starkers HTML5 3.0 */ function starkers_comment_close() { echo '
'; } /** * Adjusts the comment_form() input types for HTML5. * * @since Starkers HTML5 3.0 */ function starkers_fields($fields) { $commenter = wp_get_current_commenter(); $req = get_option( 'require_name_email' ); $aria_req = ( $req ? " aria-required='true'" : '' ); $fields = array( 'author' => '

' . ( $req ? '*' : '' ) . '

', 'email' => '

' . ( $req ? '*' : '' ) . '

', 'url' => '

' . '

', ); return $fields; } add_filter('comment_form_default_fields','starkers_fields'); /** * Register widgetized areas. * * @since Starkers HTML5 3.0 */ function starkers_widgets_init() { register_sidebar( array( 'name' => __( 'Laurel Widget Area', 'starkers' ), 'id' => 'laurel-widget-area', 'description' => __( 'Laurels in the header - use one image, and make sure it is a transparent PNG no larger than 165px tall by 540px wide.', 'starkers' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Social Media Widget Area', 'starkers' ), 'id' => 'social-widget-area', 'description' => __( 'Social media icons in the navigation bar', 'starkers' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Donate Widget Area', 'starkers' ), 'id' => 'donate-widget-area', 'description' => __( 'The donate section of the page sidebar', 'starkers' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Buy Widget Area', 'starkers' ), 'id' => 'buy-widget-area', 'description' => __( 'The buy DVD and soundtrack sections of the page sidebar', 'starkers' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Blog Widget Area', 'starkers' ), 'id' => 'blog-widget-area', 'description' => __( 'Widgets that appear in the sidebar on blog pages', 'starkers' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Widget Area', 'starkers' ), 'id' => 'footer-widget-area', 'description' => __( 'The footer widget area for logos of supporting organizations', 'starkers' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } /** Register sidebars by running starkers_widgets_init() on the widgets_init hook. */ add_action( 'widgets_init', 'starkers_widgets_init' ); /** * Removes the default styles that are packaged with the Recent Comments widget. * * @updated Starkers HTML5 3.2 */ function starkers_remove_recent_comments_style() { add_filter( 'show_recent_comments_widget_style', '__return_false' ); } add_action( 'widgets_init', 'starkers_remove_recent_comments_style' ); if ( ! function_exists( 'starkers_posted_on' ) ) : /** * Prints HTML with meta information for the current post—date/time and author. * * @since Starkers HTML5 3.0 */ function starkers_posted_on() { printf( __( 'Posted on %2$s by %3$s', 'starkers' ), 'meta-prep meta-prep-author', sprintf( '', get_permalink(), esc_attr( get_the_time() ), get_the_date('Y-m-d'), get_the_date() ), sprintf( '%3$s', get_author_posts_url( get_the_author_meta( 'ID' ) ), sprintf( esc_attr__( 'View all posts by %s', 'starkers' ), get_the_author() ), get_the_author() ) ); } endif; if ( ! function_exists( 'starkers_posted_in' ) ) : /** * Prints HTML with meta information for the current post (category, tags and permalink). * * @since Starkers HTML5 3.0 */ function starkers_posted_in() { // Retrieves tag list of current post, separated by commas. $tag_list = get_the_tag_list( '', ', ' ); if ( $tag_list ) { $posted_in = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the permalink.', 'starkers' ); } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) { $posted_in = __( 'This entry was posted in %1$s. Bookmark the permalink.', 'starkers' ); } else { $posted_in = __( 'Bookmark the permalink.', 'starkers' ); } // Prints the string, replacing the placeholders. printf( $posted_in, get_the_category_list( ', ' ), $tag_list, get_permalink(), the_title_attribute( 'echo=0' ) ); } endif; // change excerpt length function custom_excerpt_length( $length ) { return 50; } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); function getTopParentPostID($myid){ $mypage = get_page($myid); if ($mypage->post_parent == 0){ return $mypage->ID; } else{ return getTopParentPostID($mypage->post_parent); } } function depthToRoot($myid,$depth){ $mypage = get_page($myid); if ($mypage->post_parent == 0){ return $depth; } else{ $depth++; return depthToRoot($mypage->post_parent, $depth); } }