Tag Info

New answers tagged

0

I'd suggest this plugin: https://wordpress.org/plugins/advanced-custom-fields/ It is very well maintained and documented. It will allow you to add one or more custom excerpt fields, manage the layout in the admin area and make them required so a post cannot be submitted without completing them.


0

The easiest course of action would be to write manual excerpts instead of having the system generate them. Second, would be to wrap your "content that isn't an excerpt" in a shortcode. If you look at the wp_trim_excerpt() function, which generates excerpts from post content, one of the first thing it does is strip shortcodes. For example, if you had a ...


2

This little function I created to see what happends when... Outcome here was showing the excerpt as wished when filled out in backend and if left empty it keeps blank. I have no idea why you have filter it that way but that is the way you wish I assume. add_filter( 'get_the_excerpt', 'if_excerpt_left_empty_show_this' ); function ...


0

There is a build in meta box to handle custom excerpts. You just need to check the excerpt option box under screen options in your post screen, once checked, you will see the excerpt editor box below your WYSIWYG editor metabox. For custom post types, make sure that you set the excerpt as support feature in your arguments when registering your post type ...


0

Add a custom field in your backend named excerpt_length (really simple, if you have issues, see this video). In your functions.php add this: global $wp_query; $postid = $wp_query->post->ID; $excerpt_length = get_post_meta($postid, 'excerpt_length', true); function custom_excerpt_length( $length ) { return $excerpt_length; } ...



Top 50 recent answers are included