How do I pull excerpts from pages?
Perhaps try this: <?php global $more; $more = false; ?> <?php the_content(‘<span>Continue Reading</span>’); ?> <?php $more = true; ?>
Perhaps try this: <?php global $more; $more = false; ?> <?php the_content(‘<span>Continue Reading</span>’); ?> <?php $more = true; ?>
Use the excerpt_more filter hook: function mytheme_excerpt_more( $text ) { $text=”…”; return $text; } add_filter( ‘excerpt_more’, ‘mytheme_excerpt_more’ );
You can utilize the wp_trim_excerpt filter. In your callback function that filters the the excerpt text, you can test for the presence of a certain template; then, if that template is being used, you can go ahead and alter the excerpt in any way that you see fit. In order to determine which template is … Read 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
You can utilize the WordPress function get_template_part(); Create several template files in your theme directory called content-POST_FORMAT_TYPE.php – Example: content-gallery.php and content-chat.php if(has_post_format(‘gallery’)) get_template_part(‘content’, ‘gallery’); elseif(has_post_format(‘chat’) get_template_part(‘content’, ‘chat’); else the_content(); This approach makes your code blocks reusable in multiple templates. Hope this helps you out.
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/
The excerpt is a specific field in WordPress and is wholly unrelated to custom fields, which is why the excerpt stuff you tried has no effect. There is no built in way to trim custom fields, you have to do it manually with a bit of php: $length = 20; $text=”Lorem ipsum dolor sit amet, … Read more
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(); ?>