Problem custom the_excerpt()
-
Hi!
I’ve made changes to the_excerpt() in functions.php using “excerpt_length”, which has worked fine until I updated the Ajax Load More plugin today to version 6.1.0.1 and WordPress to version 6.3.1.
Using the_excerpt() in a page template works fine, but the one in the Ajax Load More repeater template does not work, even though the code is exactly the same as the template. It doesn’t seem to see the changes made in functions.php.
My repeater template looks like this:
<li class="three-column<?php if (!has_post_thumbnail()) { ?> no-img<?php } ?>"> <a href="<?php the_permalink(); ?>"> <div class="img-content img-fallback"> <?php if ( has_post_thumbnail() ) { the_post_thumbnail('large'); }?> </div> <div class="text-content"> <span class="date"><?php echo get_the_date(); ?></span> <h2><?php the_title(); ?></h2> <?php the_excerpt(); ?> <span class="btn"> <?php esc_html_e( 'Read more', 'text-domain' ); ?><i class="icon-right-large"></i> </span> </div> </a> </li>
My change to the_excerpt() in functions.php looks like this:
/* Excerpt length */ function custom_excerpt_length( $length ) { return 13; } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); /* Read more dots */ function new_excerpt_more( $more ) { return '...'; } add_filter('excerpt_more', 'new_excerpt_more');
I’m not sure if it was the WordPress update or the plugin update that broke this, but since it still works in my own page templates I assume it has to do with the integration with Ajax Load More.
Thanks!
- The topic ‘Problem custom the_excerpt()’ is closed to new replies.