How can I show post excerpts on the tags page?

To show post excerpts on my tags page, you will need to make changes in content.php. By default content.php uses post excerpts for search pages only but you can modify the default behavior. This is how you can include tag pages to show post excerpts. Add || is_tag() as follows: <?php if ( is_search() || … Read more

How to Display a Single Post Excerpt

the_excerpt() is one of a few template tags that do not accept a post ID as a parameter. Instead, you need to set up the global $post, run your tags, then restore it: if ( $_post = get_post( 10 ) ) { setup_postdata( $post = $_post ); the_excerpt(); // Any other template tags for this … Read more

How to find a post id using the post_excerpt?

You can get the post ID from the excerpt, but as far as I can tell, WP_Query doesn’t support this (very well), so you need to write a custom WPDB query. function get_post_id_by_excerpt($excerpt) { global $wpdb; $result = $wpdb->get_row( $wpdb->prepare(“SELECT ID FROM {$wpdb->prefix}posts WHERE post_excerpt LIKE %s”, $excerpt) ); return $result; } For this to … Read more

Any way to get more space for editing post excerpts

Depending on the context, in which you would like to make these changes, I’d simply remove the metabox from that certain post type. Then add another metabox above the editor for your excerpt box. The downside: you can not use get_the_excerpt, the_excerpt etc. anymore because that metabox doesn’t exist any more. Have a look at … Read more

excerpt – don’t use main content if empty

WordPress sets up a default filter for get_the_excerpt: wp_trim_excerpt(). It is this function that will generate an excerpt from the content “if needed”. If you don’t want this behavior, you can just unhook the filter: add_action( ‘init’, ‘wpse17478_init’ ); function wpse17478_init() { remove_filter( ‘get_the_excerpt’, ‘wp_trim_excerpt’ ); } Now get_the_excerpt() will just return the contents of … Read more

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