', ']]>', $text); $allowed_tags = '

,,,,,'; //$allowed_tags = '

'; /*** MODIFY THIS. Add the allowed HTML tags separated by a comma.***/ $text = strip_tags($text, $allowed_tags); $excerpt_word_count = 100; /*** MODIFY THIS. change the excerpt word count to any integer you like.***/ $excerpt_length = apply_filters('excerpt_length', $excerpt_word_count); $excerpt_end = '[...]'; /*** MODIFY THIS. change the excerpt endind to something else.***/ $excerpt_more = apply_filters('excerpt_more', ' ' . $excerpt_end); $words = preg_split("/[\n\r\t ]+/", $text, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY); if ( count($words) > $excerpt_length ) { array_pop($words); $text = implode(' ', $words); $text = $text . $excerpt_more; } else { $text = implode(' ', $words); } } return apply_filters('wp_trim_excerpt', $text, $raw_excerpt); } remove_filter('get_the_excerpt', 'wp_trim_excerpt'); add_filter('get_the_excerpt', 'custom_wp_trim_excerpt'); /* Hide widget title */ add_filter('widget_title','my_widget_title'); function my_widget_title($t) { if ( ($t == 'MST') OR ( $t == 'Etiquetas') ): return null; else: return $t; endif; } /* Search BOX in MENU*/ //add_theme_support('html5', array('search-form')); add_filter( 'wp_nav_menu_items','add_search_box', 10, 2 ); function add_search_box( $items, $args ) { $items .= '

  • ' . get_search_form( false ) . '
  • '; return $items; } /* CUSTOM ENTRY META*/ if ( ! function_exists( 'twentytwelve_entry_meta' ) ) { /** * Set up post entry meta. * Prints HTML with meta information for current post: categories, tags, permalink, author, and date. * Create your own twentytwelve_entry_meta() to override in a child theme. * @since Twenty Twelve 1.0 */ function twentytwelve_entry_meta($ID) { // Translators: used between list items, there is a space after the comma. $categories_list = ''.get_the_category_list( __( ', ', 'twentytwelve' ) ).''; // Translators: used between list items, there is a space after the comma. $tag_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) ); $date = sprintf( '%1$s', esc_html( get_the_date() ) ); $author = sprintf( '%1$s', get_the_author() ) ; // Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name. if ( $tag_list ) { $utility_text = __( '%3$s - %1$s ' , 'twentytwelve' ); //$utility_text = __( 'This entry was posted in %1$s and tagged %2$s on %3$s by %4$s.', 'twentytwelve' ); } elseif ( $categories_list ) { $utility_text = __( '%3$s - %1$s ' , 'twentytwelve' ); } else { $utility_text = __( 'his entry was posted on %3$s by %4$s.', 'twentytwelve' ); } printf( $utility_text, $categories_list, $tag_list, $date, $author ); } }