excerpt in characters

I used this code in one of my last projects: function ng_get_excerpt( $count ){ $permalink = get_permalink( $post->ID ); $excerpt = get_the_content(); $excerpt = strip_tags( $excerpt ); $excerpt = mb_substr( $excerpt, 0, $count ); $excerpt = mb_substr( $excerpt, 0, strripos( $excerpt, ” ” ) ); $excerpt = rtrim( $excerpt, “,.;:- _!$&#” ); $excerpt = $excerpt … Read more

Display Links in Excerpts?

You can use the script I found here: http://aaronrussell.co.uk/legacy/improving-wordpress-the_excerpt/ I’ve modified it to show links in the excerpt, and removed some of the other functions: <?php function keep_my_links($text) { global $post; if ( ” == $text ) { $text = get_the_content(”); $text = apply_filters(‘the_content’, $text); $text = str_replace(‘\]\]\>’, ‘]]&gt;’, $text); $text = preg_replace(‘@<script[^>]*?>.*?</script>@si’, ”, $text); … Read more

Remove “Continue Reading” Link From the Teaser Excerpt Only

Change standard text for all excerpts: function custom_excerpt_more($more) { global $post; $more_text=”…”; return ‘… <a href=”‘. get_permalink($post->ID) . ‘”>’ . $more_text . ‘</a>’; } add_filter(‘excerpt_more’, ‘custom_excerpt_more’); Create your own excerpt function: // Rafael Marques Excerpt Function 😉 function rm_excerpt($limit = null, $separator = null) { // Set standard words limit if (is_null($limit)){ $excerpt = explode(‘ … Read more

How to get the unfiltered excerpt, without […] or auto-excerpting

Why don’t you use the global $post variable? It contains an object with the content as it is on the db row corresponding to that post. Here’s how to use it: global $post; // If for some reason it’s readily accessible, invoke it if($post->post_excerpt != ”) { echo($post->post_excerpt); } Or: $my_post = get_post($post_id); if($my_post->post_excerpt != … Read more

How to control manual excerpt length?

Take a look on my answer here: Best Collection of Code for your functions.php file If I understood your question correctly, it does what you are looking for. Place this in functions.php: function excerpt($num) { $limit = $num+1; $excerpt = explode(‘ ‘, get_the_excerpt(), $limit); array_pop($excerpt); $excerpt = implode(” “,$excerpt).”… (<a href=”” .get_permalink($post->ID) .” “>Read more</a>)”; … Read more

How to include line-breaks in the_excerpt?

There is no filter that would allow you to set allowable tags not to be removed by the_excerpt(). Arguably a shortcoming of the core. Anyhow, the actual excerpt generation does not happen in that template tag but entirely elsewhere: Excerpts are generated by the function wp_trim_excerpt(), inside of which the excerpt filters you are already … Read more

Compare the_excerpt() to the_content()

What you’re trying to do with the video is exactly what Post Formats were created to handle. Add this to functions: add_theme_support( ‘post-formats’, array( ‘video’ ) ); And then this to handle your Read More link: if( !has_post_format( ‘video’ ) ) { echo ‘<a href=”‘ . get_permalink() . ‘”>Read More&hellip;</a>’; } else { echo ‘<a … Read more

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