' .$mantra_excerptcont.' ' . ''; } /** * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and mantra_continue_reading_link(). * * To override this in a child theme, remove the filter and add your own * function tied to the excerpt_more filter hook. * * @since mantra 0.5 * @return string An ellipsis */ function mantra_auto_excerpt_more( $more ) { global $mantra_excerptdots; return $mantra_excerptdots. mantra_continue_reading_link(); } add_filter( 'excerpt_more', 'mantra_auto_excerpt_more' ); /** * Adds a pretty "Continue Reading" link to custom post excerpts. * * To override this link in a child theme, remove the filter and add your own * function tied to the get_the_excerpt filter hook. * * @since mantra 0.5 * @return string Excerpt with a pretty "Continue Reading" link */ function mantra_custom_excerpt_more( $output ) { if ( has_excerpt() && ! is_attachment() ) { $output .= mantra_continue_reading_link(); } return $output; } add_filter( 'get_the_excerpt', 'mantra_custom_excerpt_more' ); /** * Adds a "Continue Reading" link to post excerpts created using the tag. * * To override this link in a child theme, remove the filter and add your own * function tied to the the_content_more_link filter hook. * * @since mantra 2.1 * @return string Excerpt with a pretty "Continue Reading" link */ function mantra_more_link($more_link, $more_link_text) { global $mantra_excerptcont; $new_link_text = $mantra_excerptcont; if (preg_match("/custom=(.*)/",$more_link_text,$m) ) { $new_link_text = $m[1]; }; $more_link = str_replace($more_link_text, $new_link_text.' ', $more_link); $more_link = str_replace('more-link', 'continue-reading-link', $more_link); return $more_link; } add_filter('the_content_more_link', 'mantra_more_link',10,2); /** * Allows post excerpts to contain HTML tags * @since mantra 1.8.7 * @return string Excerpt with most HTML tags intact */ function mantra_trim_excerpt($text) { global $mantra_excerptwords; global $mantra_excerptcont; global $mantra_excerptdots; $raw_excerpt = $text; if ( '' == $text ) { //Retrieve the post content. $text = get_the_content(''); //Delete all shortcode tags from the content. $text = strip_shortcodes( $text ); $text = apply_filters('the_content', $text); $text = str_replace(']]>', ']]>', $text); $allowed_tags = ',,,,