Show Page Excerpts for Page Post Type in Search Results

We want to show page excerpts (taken from Cornerstone content) for the page post-types in the search results. All other post types (including custom post types) show excerpts. The excerpt section is still present in the HTML for pages in the search results, but they are blank.

How can we add ‘automated’ page excerpts for the page post type? (We’re not interested in the custom page excerpts.)

Thanks!

The image below should illustrate what I’m referring to.

Hello @coloffdigital,

Thanks for writing in!

By default, pages do not have excerpts. Pages are usually used as the landing page, where the post is for blog articles and that’s what separates them. And the theme will adhere to the default standard provided by Wordpress.

Page having an excerpt is still doable, but again, would require customization. Example,

https://www.wpbeginner.com/plugins/add-excerpts-to-your-pages-in-wordpress/3 (for adding excerpt support for Pages).
https://www.wpbeginner.com/beginners-guide/how-to-add-featured-image-or-post-thumbnails-in-wordpress/1 ( for adding featured image support for Pages)

Hope this helps.

Hey @RueNel,

Thanks for your quick response!

I actually tried adding the excerpt support already via that first link you sent, but the excerpt still does not appear in the search results for the page post type.

If you could explain which files within the X Pro theme could be edited to add page excerpts for pages, that would be fantastic.

Thanks for the help!

Hey @coloffdigital,

Are all of you pages created using the Cornerstone plugin or Pro Editor? If that is the case, then you will have to insert a manual excerpt for each respective page because the auto excerpt will be dynamically generated from the first 55 words of the page content. When you use Pro editor or Cornerstone, the contents will be wrapped with formatting shortcodes by which the auto excerpt will ignore thus no excerpt will be generated. To remedy this situation, you will need to edit each of the pages and then insert the manual excerpts. Manual Excerpts are optional hand-crafted summaries of your content that can be used in your theme. Click here to learn more about manual excerpts.

Regards.

Hey @RueNel,

Nearly all of our pages are created with the Cornerstone plugin.

We were wondering if there was some way to get around this obstacle…

We’ve got a custom post type for News. Some of these pages that are built in Cornerstone, using the text elements from Cornerstone, still display excerpts taken directly from these text elements (in the search results).

If this is happening, doesn’t that mean we should be able to do the same for our other post types?

Thanks,

Hey @coloffdigital,

That is an automatic excerpt and that is not available for the page post type. Adding excerpt support for the page post type will enable the “manual” excerpt only.

It might be possible to hack the page post type but that would be outside the scope of our support.

Thank you for understanding.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.