Title: Please use
Last modified: July 9, 2025

---

# Please use

 *  [Matthieu](https://wordpress.org/support/users/theschappy/)
 * (@theschappy)
 * [11 months ago](https://wordpress.org/support/topic/please-use/)
 * Hi,
 * thanks for the great plugin. Would be great, if you could make use of existing
   WordPress methods to acquire the excerpt to be displayed in the card. The method
   is called `[get_the_excerpt](https://developer.wordpress.org/reference/functions/get_the_excerpt/)`
   because it also provides filters to change the content of excerpt for the whole
   WordPress site.
 * Please find attached a patch to make use of the function. Furthermore, you can
   consider to make use of the filter `[excerpt_length](https://developer.wordpress.org/reference/hooks/excerpt_length/)`
   to change the size of the excerpt. Thus, you could benefit from the more readable
   word-based excerpt shortening, which leaves words in the excerpt intact.
 *     ```wp-block-code
       --- lib/class-childpagescard.org.php    2025-07-09 16:10:43.766264250 +0200+++ lib/class-childpagescard.php        2025-07-09 16:33:01.166148567 +0200@@ -224,11 +224,11 @@                                        $title = $child->post_title . ' - ' . get_option( 'blogname' );-                                       $excerpt = null;+                                       $excerpt = get_the_excerpt($child->ID);                                        if ( function_exists( 'mb_substr' ) ) {-                                               $excerpt = mb_substr( strip_shortcodes( wp_strip_all_tags( $child->post_content ) ), 0, $settings['excerpt'] ) . '...';-                                       } else {-                                               $excerpt = substr( strip_shortcodes( wp_strip_all_tags( $child->post_content ) ), 0, $settings['excerpt'] ) . '...';+                                                $excerpt = mb_substr( $excerpt, 0, $settings['excerpt'] ) . '...';+                                        } else {+                                                $excerpt = substr( $excerpt, 0, $settings['excerpt'] ) . '...';                                        }                                        $url = get_permalink( $child->ID );
       ```
   

The topic ‘Please use’ is closed to new replies.

 * ![](https://ps.w.org/child-pages-card/assets/icon-256x256.png?rev=2189351)
 * [Child Pages Card](https://wordpress.org/plugins/child-pages-card/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/child-pages-card/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/child-pages-card/)
 * [Active Topics](https://wordpress.org/support/plugin/child-pages-card/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/child-pages-card/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/child-pages-card/reviews/)

## Tags

 * [excerpt](https://wordpress.org/support/topic-tag/excerpt/)

 * 0 replies
 * 1 participant
 * Last reply from: [Matthieu](https://wordpress.org/support/users/theschappy/)
 * Last activity: [11 months ago](https://wordpress.org/support/topic/please-use/)
 * Status: not resolved