'', 'default-text-color' => '333', 'width' => 300, 'height' => 100, 'flex-width' => true, 'flex-height' => true, 'wp-head-callback' => 'responsive_header_style', 'admin-head-callback' => 'responsive_admin_header_style', 'admin-preview-callback' => 'responsive_admin_header_image', ) ) ); } add_action( 'after_setup_theme', 'responsive_custom_header_setup' ); if ( ! function_exists( 'responsive_header_style' ) ) : /** * Styles the header image and text displayed on the blog */ function responsive_header_style() { // If no custom options for text are set, let's bail // get_header_textcolor() options: HEADER_TEXTCOLOR is default, hide text (returns 'blank') or any hex value if ( HEADER_TEXTCOLOR == get_header_textcolor() ) return; // If we get this far, we have custom styles. Let's do this. ?> Header admin panel. */ function responsive_admin_header_style() { ?> Header admin panel. */ function responsive_admin_header_image() { ?>
tag based on what is being viewed. */ function responsive_wp_title( $title, $sep ) { global $page, $paged; if ( is_feed() ) return $title; // Add the blog name $title .= get_bloginfo( 'name' ); // Add the blog description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title .= " $sep $site_description"; // Add a page number if necessary: if ( $paged >= 2 || $page >= 2 ) $title .= " $sep " . sprintf( __( 'Page %s', 'responsive' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'responsive_wp_title', 10, 2 ); /** * Sets the post excerpt length to 40 words. * Adopted from Coraline */ function responsive_excerpt_length($length) { return 40; } add_filter('excerpt_length', 'responsive_excerpt_length'); /** * Returns a "Read more" link for excerpts */ function responsive_read_more() { return ''; } /** * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and responsive_read_more_link(). */ function responsive_auto_excerpt_more($more) { return '…' . responsive_read_more(); } add_filter('excerpt_more', 'responsive_auto_excerpt_more'); /** * Adds a pretty "Read more" link to custom post excerpts. */ function responsive_custom_excerpt_more($output) { if ( has_excerpt() && ! is_attachment() ) { $output .= responsive_read_more(); } return $output; } add_filter( 'get_the_excerpt', 'responsive_custom_excerpt_more' ); /** * This function prints post meta data. * * Ulrich Pogson Contribution */ if (!function_exists('responsive_post_meta_data')) : function responsive_post_meta_data() { printf( __( 'Posted on %2$s by %4$s', 'responsive' ), 'meta-prep meta-prep-author posted', sprintf( ' ', get_permalink(), esc_attr( get_the_time() ), get_the_date() ), 'byline', sprintf( ' ', get_author_posts_url( get_the_author_meta( 'ID' ) ), sprintf( esc_attr__( 'View all posts by %s', 'responsive' ), get_the_author() ), get_the_author() ) ); } endif; /** ---------------------------------- */ /** Need to deal with everything below */ /** ---------------------------------- */ /** * Breadcrumb Lists * Allows visitors to quickly navigate back to a previous section or the root page. * * Adopted from Dimox * */ if ( ! function_exists( 'responsive_breadcrumb_lists' ) ) : function responsive_breadcrumb_lists() { $cat_parents = null; $options = get_theme_mod( 'breadcrumbs' ); if ( 'no' == $options ) { return; } else { $chevron = '›'; $home = __('Home','responsive'); // text for the 'Home' link $before = ' '; // tag after the current crumb if ( ! is_home() && ! is_front_page() || is_paged() ) { echo ' '; } } } endif; /** * This function removes .menu class from custom menus * in widgets only and fallback's on default widget lists * and assigns new unique class called .menu-widget * * Marko Heijnen Contribution * */ class responsive_widget_menu_class { public function __construct() { add_action( 'widget_display_callback', array( $this, 'menu_different_class' ), 10, 2 ); } public function menu_different_class( $settings, $widget ) { if( $widget instanceof WP_Nav_Menu_Widget ) add_filter( 'wp_nav_menu_args', array( $this, 'wp_nav_menu_args' ) ); return $settings; } public function wp_nav_menu_args( $args ) { remove_filter( 'wp_nav_menu_args', array( $this, 'wp_nav_menu_args' ) ); if( 'menu' == $args['menu_class'] ) $args['menu_class'] = 'menu-widget'; return $args; } } new responsive_widget_menu_class(); /** * Removes div from wp_page_menu() and replace with ul. */ function responsive_wp_page_menu ($page_markup) { preg_match('/^