Tag Info

New answers tagged

1

This code could work, I'm using the setup_postdata to create a post object similar to what the function the_post() does, so now you can use the functions you have in a Loop. $recent_posts = wp_get_recent_posts( array( 'numberposts' => 3, 'orderby' => 'post_date', 'order' => ...


2

The post_excerpt value is empty because you have no explicit excerpts for your posts. While the_excerpt() does generate an excerpt from the posts content if the post excerpt is empty, the function wp_get_recent_posts(), which is basically a wrapper for get_posts(), doesn't.


2

in content.php change <?php the_excerpt(); ?> with <?php the_content(); ?> Or use this content.php file instead. I made changes in your content.php <?php /** * The default template for displaying content * * Used for both single and index/archive/search. * * @package WordPress * @subpackage AsperTheme * @since AsperTheme 1.0 */ ...


1

I know that question was more than 2 years ago but I think here's more correct answer. function new_excerpt_more($more) { global $post; return $more . '<a href="'. get_permalink( $post->ID ). '" class="readmore">more &raquo;</a>'; } add_filter('the_excerpt', 'new_excerpt_more'); Even if your excerpt is filled the "readmore" link ...


0

$query = new WP_Query( 'pagename=about' ); // The Loop while ( $query->have_posts() ) { $query->the_post(); ?> <header class="entry-header"> <h2 class="entry-title"> <?php the_title(); ?> </h2> </header> <div class="entry-summary"> <?php the_excerpt(); ?> ...


0

EDIT Seems that I some how misunderstood you. I do think you are missing the point of the post_excerpt. When you create a new post or page (AFAIK for pages as well), you have the opportunity to create a manual excerpt in the excerpt meta box (to make it available, just enable it in screen options dropdown when in the add new/edit post/page screen). This ...


0

Add this code into functions.php, it will add support for excerpts in Pages <?php add_action('init', 'my_custom_init'); function my_custom_init() { add_post_type_support( 'page', 'excerpt' ); } ?> Use this to show up the excerpt.. $pages = get_pages(array ('post_type' => 'page','sort_column' => 'menu_order')); foreach ...


0

If you have direct access to your WordPress database, you could use a tool like PHPMyAdmin or HeidiSQL to query the post and user tables and extract the information you need from the appropriate tables. I discuss how an SQL query is constructed to get specific categories in Does WordPress Offer A Way to Get only Child Categories?. You can probably construct ...


0

It happens because using explode() to parse HTML is at least equally evil as trying to do it with regex. To “fix” it, the quick ’n dirty way, you could add the following preg_replace() after the implode() line: $wpse0001_excerpt = implode( '</p>', $tmp_to_add ).'</p>'; $wpse0001_excerpt = preg_replace( '/<\/p>\s*<\/p>/', ...



Top 50 recent answers are included