Why don't you just limit the string using substr () ?
$content = $page_data->post_content; $excerpt = substr($content, 0, 155);
something like that
at this speed, you donβt need to try to find the true shutter speed variable, and you can control the length, whether it has ellipses at the end, etc.
Also, if you need to find excerpt variables, you can just do var_dump($page_data) and see what returns the required value, no?
EDIT:
you can try adding manual excerpts to pages using this function in functions.php function
add_action( 'init', 'my_add_excerpts_to_pages' ); function my_add_excerpts_to_pages() { add_post_type_support( 'page', 'excerpt' ); }
Change to EDIT:
So, I just dug a little deeper, and this little guy here can help you. Add this to your functions.php file ( source )
add_post_type_support( 'page', 'excerpt' );
source share