How to create excerpt for custom post type automatically?

Posted in: Newspaper
Post count: 61

In Newspaper theme, excerpts created automatically, without need to fill an excerpt field.
But on custom post type, I need to manually fill excerpt field. How to do it automatically, same way as it for default post types?

Thanks

Post count: 35449

Hi,

Please read our documentation about Excerpts for blocks and modules -> https://forum.tagdiv.com/excerpts-introduction/
Here is the list with the modules that create blocks.
Theme modules and blocks -> https://forum.tagdiv.com/theme-blocks-modules/
Hope this will help you.

Thank you.

Post count: 61

I have 3 instances of Flex Block 5. ON two of them excerpt shown by default, as I use there usual posts. On third one, it’s not shown, as I have there custom post types “events”. My custom post type support Excerpt, I just want it to be filled automatically, same way as on default posts.

Post count: 35449

Hi,

I don’t quite understand the problem you are referring to, some more details and screenshots, that would be very helpful.

Thank you for your understanding.

Post count: 61

I’ve created custom post type – ‘edi’. It has: Title,Content Editor,Featured Image,Excerpt.
I created single-edi.php, ant it display the data I enter like here:

cpt

Now I want to display it on home page, and I choose on block option post type:

cpt

And choose show excerpt:

cpt

Result:

Excerpt not shown, only post name, image. IF I fill excerpt field manually, for ‘edi’, it shown as expected.

So question is – how to make it work automatically, as usual posts in theme.

Thanks

Post count: 35449

Hi,

You need to set a condition, if the expected in edi is empty then will be set the content, else will be set the expected.

Thank you for your understanding.

Post count: 61

Hi, Calin. Can you, please point me, where to set such condition? I use CPT UI plugin, and ACF Pro.

Thanks

Post count: 35449

Hi,

You’ll get the function in wp-content>theme>Newspeper>inculdes>wp_booster>td_nodule.php
https://www.screencast.com/t/uyBiyFkOPy
https://www.screencast.com/t/2cc4arc9XJP
Hope this will help you.

Thank you.

Viewing 8 posts - 1 through 8 (of 8 total)
The forum ‘Newspaper’ is closed to new topics and replies.