• id="li-comment-">
  • ' . __( 'Read more ›', 'responsive' ) . ''; } /** * 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 removes inline styles set by WordPress gallery. */ function responsive_remove_gallery_css( $css ) { return preg_replace( "##s", '', $css ); } add_filter( 'gallery_style', 'responsive_remove_gallery_css' ); /** * This function removes default styles set by WordPress recent comments widget. */ function responsive_remove_recent_comments_style() { global $wp_widget_factory; if ( isset( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'] ) ) { remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) ); } } add_action( 'widgets_init', 'responsive_remove_recent_comments_style' ); /** * wp_title() Filter for better SEO. * * Adopted from Twenty Twelve * @see http://codex.wordpress.org/Plugin_API/Filter_Reference/wp_title * */ if ( !function_exists( 'responsive_wp_title' ) && !defined( 'AIOSEOP_VERSION' ) ) : function responsive_wp_title( $title, $sep ) { global $page, $paged; if ( is_feed() ) { return $title; } // Add the site name. $title .= get_bloginfo( 'name' ); // Add the site 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 ); 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'] = apply_filters( 'responsive_menu_widget_class', 'menu-widget' ); } return $args; } } $GLOBALS['nav_menu_widget_classname'] = new responsive_widget_menu_class(); /** * Removes div from wp_page_menu() and replace with ul. */ function responsive_wp_page_menu( $page_markup ) { preg_match( '/^
    /i', $page_markup, $matches ); $divclass = $matches[1]; $replace = array( '
    ', '
    ' ); $new_markup = str_replace( $replace, '', $page_markup ); $new_markup = preg_replace( '/^