excerpt box not visible
Do you have the excerpt field enabled in screen options? Screen options is in the top right-hand corner the screen, next to the help button (under the logout link).
Do you have the excerpt field enabled in screen options? Screen options is in the top right-hand corner the screen, next to the help button (under the logout link).
Try to go in a completely different way about that and this code to your functions.php // Variable excerpt length. function dynamic_excerpt($length) { // Variable excerpt length. Length is set in characters global $post; $text = $post->post_excerpt; if ( ” == $text ) { $text = get_the_content(”); $text = apply_filters(‘the_content’, $text); $text = str_replace(‘]]>’, ‘]]>’, … Read more
You are using more tag to split article into teaser and rest of content. “More” link assumes that reader already done with former and tries to navigate browser to that point in full article. Codex has modifying this behavior documented in Customizing the Read More > Prevent Page Scroll When Clicking the More Link and … Read more
You need to be using setup_postdata($post); as in all of the examples for get_posts. You need: $myposts = get_posts(‘numberposts=5’); foreach($myposts as $post) : setup_postdata($post); // the rest of your function
You need to be using setup_postdata foreach($all_posts as $post): setup_postdata($post); // the rest of your loop If you look at the docs for get_posts you will see that in all of the examples.
You can use the wp_trim_excerpt() to get the excerpt of the content. You can use it inside your loop to get the excerpt of each post the string provided to a maximum of 55 words if it is more then a […] will be added to the end of the string. <?php $recent_posts = wp_get_recent_posts(array(‘post_type’=>’jokes’)); … Read more
The problem is the difference between the teaser and excerpt which is mistaken one for another in many case. The excerpt_more filter that you are using will change the teaser more text, not the excerpt. The right filter for this is the get_the_excerpt. But it doesn’t change the […] of the excerpt, it gives you … Read more
This works. You probably just had a syntax error. function content( $limit ) { global $post; if( has_excerpt() ){ $content = the_excerpt(); } else { $content = explode( ‘ ‘, get_the_content(), $limit ); if ( count($content) >= $limit ) { array_pop( $content ); $content = implode( ” “, $content ); $content = wp_strip_all_tags( $content, true … Read more
Answering my own question. Solved with an if else statement using has_excerpt. if( has_excerpt ( $_post, ID ) ) { $author = sprintf( ‘<a href=”https://wordpress.stackexchange.com/questions/224893/%1$s”>Apply</a>’, esc_attr( get_the_excerpt( $_post ) ) ); } else { $author=””; } It only makes sense, really.
Please add below code in theme functions.php remove_filter( ‘the_excerpt’, ‘wpautop’ );