Advertisement
fahimmurshed

Add ellipsis [...] on the post archive

Mar 1st, 2024
636
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. /**
  2.  * Theme's overridden of excerpt function
  3.  */
  4. function astra_the_excerpt() {
  5.  
  6.     $excerpt_type = apply_filters( 'astra_excerpt_type', astra_get_option( 'blog-post-content' ) );
  7.  
  8.     do_action( 'astra_the_excerpt_before', $excerpt_type );
  9.     ?>
  10.         <div class="ast-excerpt-container ast-blog-single-element">
  11.             <?php
  12.             if ( 'full-content' === $excerpt_type ) {
  13.                 the_content();
  14.             } else {
  15.                 the_excerpt();
  16.             }
  17.             ?>
  18.         </div>
  19.     <?php
  20.  
  21.     do_action( 'astra_the_excerpt_after', $excerpt_type );
  22. }
  23.  
  24. /**
  25.  * Filter to change the excerpt more string to dots ...
  26.  */
  27. add_filter( 'excerpt_more', 'extended_excerpt_more' );
  28. function extended_excerpt_more( $more ) {
  29.     return '[...]';
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement