Remove [ and ] from excerpt
Use the excerpt_more filter hook: function mytheme_excerpt_more( $text ) { $text=”…”; return $text; } add_filter( ‘excerpt_more’, ‘mytheme_excerpt_more’ );
Use the excerpt_more filter hook: function mytheme_excerpt_more( $text ) { $text=”…”; return $text; } add_filter( ‘excerpt_more’, ‘mytheme_excerpt_more’ );
Why not just switch out the_excerpt for the_content in your theme? Or create a child theme and override the relevant files. http://codex.wordpress.org/Child_Themes
If you add support for Post Thumbnails, you can use its own function instead of get_post_meta(), see codex for more information – http://codex.wordpress.org/Post_Thumbnails#Function_Reference Use following code in your theme: <div class=”postcont> <?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } the_excerpt(); ?> </div> EDIT And using the OP’s code: $args = array( ‘numberposts’ => 5, ‘category’ … Read more
From Twenty Ten’s functions.php: /** * Returns a “Continue Reading” link for excerpts * * @since Twenty Ten 1.0 * @return string “Continue Reading” link */ function twentyten_continue_reading_link() { return ‘ <a href=”‘. get_permalink() . ‘”>’ . __( ‘Continue reading <span class=”meta-nav”>→</span>’, ‘twentyten’ ) . ‘</a>’; } /** * Replaces “[…]” (appended to automatically generated … Read more
wordPress does this by default. you can either use a plugin such as: http://wordpress.org/extend/plugins/advanced-excerpt/ http://wordpress.org/extend/plugins/the-excerpt-re-reloaded/ or write your own functions to remove the default filters from the_excerpt() such as: http://bacsoftwareconsulting.com/blog/index.php/wordpress-cat/how-to-preserve-html-tags-in-wordpress-excerpt-without-a-plugin/
To show excerpts on home page and all archive pages, open content.php and modify the following line: <?php the_content( __( ‘Continue reading <span class=”meta-nav”>→</span>’, ‘twentyeleven’ ) ); ?> with this: <?php the_excerpt(); ?>
Change line 9 to: $content = get_the_excerpt(); the_excerpt() echoes the excerpt. get_the_excerpt() returns it.
Assuming your content is in the variable $content you would begin by removing all html tags using wp_strip_all_tags: $new_content = wp_strip_all_tags( $content ); Then you will want to trim that to 200 characters using substr: $new_content = substr( $new_content, 0, 200 ); To retrieve the YouTube video, you’ll need to use preg_match: preg_match( ‘/(<iframe.*?src=”https://wordpress.stackexchange.com/questions/154352/(.*?youtube.*?)”.*?<\/iframe>)/’, $html, … Read more
The easiest course of action would be to write manual excerpts instead of having the system generate them. Second, would be to wrap your “content that isn’t an excerpt” in a shortcode. If you look at the wp_trim_excerpt() function, which generates excerpts from post content, one of the first thing it does is strip shortcodes. … Read more
Hi @janoChen: Your theme (or a plugin) is overriding your filter. Try increasing the priority like this: add_filter(‘excerpt_more’, ‘new_excerpt_more’,11); Or like this: add_filter(‘excerpt_more’, ‘new_excerpt_more’,20); And if that doesn’t work try: add_filter(‘excerpt_more’, ‘new_excerpt_more’,100);