Archived topic
No excerpt appears on custom post type
7 replies · Started by MsJenifer on February 2, 2023
I created a portfolio custom post type but the excerpt does not appear when I create a query loop to display dynamically. And, the dynamic image appears on the front-end, but on the backend--is this strange?
Hi there,
Can you show me where the query loop is?
Hi, They're two:
1) homepage under latest projects
2) Element - Portfolio Archive
1. I see that you are trying to usepost meta excerpt to output the excerpt, I checked the ACF, the field name is actually project_excerpt not excerpt, so try replace it with project_excerpt in your query loop setting.
2. The Element - Portfolio Archive is assigned to a static page called Poforlio, well, as the element is set to loop template, the location has to have a default loop, but a static page doesn't have it, so the entire element is not going to output anything.
The location should be Portfolio archive, if you don't see it, make sure the has archive is set to true for the CPT.
Hi Ying,
Thanks for the quick response:
1) Can I use Content Source excerpt instead? Similar to how a regular post work?
2) Is "Portfolio archive" a link? Forgive my ignorance?
Thanks!
1. Yes, you can select Excerpt for the dynamic content source.
https://www.screencast.com/t/cCVEUiy2C
But your CPT doesn't have the editor enabled, so they don't really have any content other than the ACF fields.
Since they don't have any content, they will NOT have any excerpt either, unless you manually add custom excerpts.
2. Portfolio archive is an index page, it's the same as blog, and it's generated automatically by WordPress.
You can find the Has archive setting in the CPT UI:
https://www.screencast.com/t/wVh9UPeX8UBe
Okay got it.
1) I enabled the editor, now I see excerpt as an option.
2) I enabled has archive so that works-the portfolio page now uses the portfolio-archive template. Woo-hoo!
Thank you, thank you thank you.
No problem :)
Happy to help!