Include post title in readmore link?

If the following code is in-fact the code that is controlling your read more link then you perhaps the following may work; if ($show_more_tag) { global $post; $excerpt = $excerpt . ‘ <a class=”more-link” href=”‘ . $perma_link . ‘”>’ . get_the_title($post->ID) . ‘ </a>’; } I’ve declared global $post; again, just in case the above … Read more

Custom Excerpts Per Page

Here’s a solution that should do what you want (per your questions in comments and chat): Functions.php function wpse102641_custom_excerpt_length( $length ) { // assuming your category is called “Stories” if ( is_category( ‘Stories’ ) ) { return 50; } // return default length return $length; } add_filter( ‘excerpt_length’, ‘wpse102641_custom_excerpt_length’, 999 ); References Codex: is_category()

Show the excerpt in a loop

get_the_excerpt function has issues using it with wp_get_recent_posts so instead of get_the_excerpt function use wp_trim_excerpt function in your code as displayed below. <?php $args = array( ‘numberposts’ => ‘3’ ); $recent_posts = wp_get_recent_posts( $args ); foreach( $recent_posts as $recent ){ ?> <div class=”wpb_column vc_column_container vc_col-sm-4″> <div class=”wpb_wrapper”> <div class=”wpb_text_column wpb_content_element wpb_animate_when_almost_visible wpb_left-to-right wpb_start_animation”> <div class=”wpb_wrapper”> … Read more

Line in excerpt and max 5 lines

If you type your poets like this in the editor and separate them by new lines: This is a phrase This is another phrase Then you can divide them by new line, and then return them to the front-end. You can do this by using the get_the_excerpt filter. This goes in your theme’s functions.php file: … Read more

Where is the logic that defines the excerpt?

From what I understand in the default-filters.php file a filter is applied to the ‘get_the_filter’ filter. The callback is for a method called ‘wp_trim_execrpt’. This is found in formatting.php. From there you can see the logic. Hope that helps.

Remove box character after excerpts. Special Character Bug

You’ll want to use the excerpt_more filter to modify this text. e.g.: function mytheme_filter_excerpt_more( $more ) { return $more=”[read more]”; } add_filter( ‘excerpt_more’, ‘mytheme_filter_excerpt_more’ ); You’ll also want to make sure that nothing else is applying this filter, as it may be the cause of your problem. (If not that, then there is probably an … Read more

Show validation warning if no Excerpt is added

Writing your own plugin will help you understand WordPress better, subsequently enjoying it even more, beside you look like you are quite capable with some tiny bit of PHP, no? When saving a post, the save_post hook is pulled on. This passes along the $post_ID and the $post variables, containing everything you need to check … Read more

Remove Text within Header tags in the Excerpt

Rather than messing with regex, you might consider using a user-defined excerpt (i.e. a manual excerpt, which retains HTML tags, rather than relying solely on the automatic excerpt, which strips HTML tags. Depending on your specific use case, using the manual excerpt for displaying HTML-formatted excerpts is usually an easier approach.

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)