The excerpt: Display text OR image OR video

I would encourage you to consider using post formats. You can see my answer to a similar question about altering the “Read More” text, but it would apply similarly to you. For the video portion, you might want to create a custom field to hold the video URL, but otherwise, I imagine this would be … Read more

Different ‘read more’ links

How about using condition to change the readmore links. Here is an sample code which returns a different read more text based upon the category of post. You should read the official codex page to know more about other conditional tags you can use in wordpress. Usage – put this code into your theme’s functions.php … Read more

can hyperlinks be displayed in excerpts?

WordPress uses the filter wp_trim_excerpt to strip the tags. You can remove the filter and create your own which will allow the links: <?php function new_wp_trim_excerpt($text) { $raw_excerpt = $text; if ( ” == $text ) { $text = get_the_content(”); $text = strip_shortcodes( $text ); $text = apply_filters(‘the_content’, $text); $text = str_replace(‘]]>’, ‘]]>’, $text); $text … Read more

Empty excerpt using wp_get_recent_posts

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.

Read more does not show up when I write my own Excerpt

Perhaps a conditional statement like the following will work. The logic is: “If the post has an explicit excerpt, add a read more link. Otherwise, use default excerpt behavior.” if($post->post_excerpt) { the_excerpt(); echo ‘<a href=”‘.get_permalink().'”>Read More</a>’; } else { the_excerpt(); } You can use this in combination with Gavin’s suggestion to unify the appearance of … Read more

Custom excerpt showing first paragraph (with HTML formatting)

Here is a function that keeps HTML tags in tact, adds a “Read More” link at the end of the excerpt and trims the excerpt after the first paragraph. if ( ! function_exists( ‘wpse0001_custom_wp_trim_excerpt’ ) ) : function wpse0001_custom_wp_trim_excerpt($wpse0001_excerpt) { global $post; $raw_excerpt = $wpse0001_excerpt; if ( ” == $wpse0001_excerpt ) { $wpse0001_excerpt = get_the_content(”); … Read more

How to get the excerpts of all children pages

Firstly, it should be post_excerpt. Secondly, this just stores the manually added excerpt, so it returns empty if you don’t have one. Thirdly, you could setup_postdata: <?php $pagechildren = get_pages( array( ‘child_of’ => $post->ID ) ); ?> <?php foreach ( $pagechildren as $post ) : setup_postdata( $post ); ?> // code <?php endforeach; wp_reset_postdata(); ?> … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)