[wp-hackers] parent page excerpt??
piemanek at gmail.com
Thu Jul 7 09:53:41 UTC 2011
> I'm wanting to show the title and excerpt of a parent page (i've enabled
> excerpts for pages) when visiting a child page. If not a child, show the
> normal excerpt and title. TItle works but excerpt won't on the child pages.
> Here's simplified code:
get_the_excerpt doesn't take any parameters, it can only be used within the
echo $parent->post_excerpt will return the excerpt of your parent post.
i'm not at my PC at the moment so not sure if that applies the correct
filters or not, so you might need to do:
echo apply_filters( 'the_excerpt', $parent->post_excerpt )
More information about the wp-hackers