Excerpts in recent posts

Hi there

I would like to Show Excerps in recent Posts. I followed the instructions in this Topic but it didn’t work. Whad did I do wrong?


Thank you very much for your help.

Hello Felix,

Thanks for posting in!

Did you properly added the PHP code right in your child theme’s functions.php file? The code should have work after saving your changes. I just noticed that you have installed a caching plugin LiteSpeed Cache, please clear your plugin cache before testing your site. This can cause the changes to not take place on the front end. It will eventually show up when the cache regenerates, but it’s not ideal if you’re looking to see your changes immediately. Caching plugins are best to turn on only when you’ve finished building the site.

Hope this helps. Kindly let us know.

Hi RueNel

Thank you for your Reply. I have deactivated the LiteSpeed Cache plugin, but the excerpts are still not showing up. I think I have added properly the PHP Code in…wp-admin/theme-editor.php?file=functions.php&theme=x-child

Thank you very much for your help.

Hey Felix,

The thread that you tried to follow seems to be outdated.

Please try this:

Hope this helps.

Hi Jade

Thank you very much for your help. Please can you send me the link ti this thread you have mentioned. I only can see the first question from BeeKeen

Thank you very much.

Hello Felix,

Thanks for updating the thread.

Here’s the thread link that you can take a look. https://theme.co/apex/forum/t/show-excerpt-in-recent-posts-widget/18296

Thanks.

Hello Prasant

Thank you very much for your great help. This PHP Code works perfekt, even with the “recent posts element”.

But I would like to still show the date of my posts and the excerpts. Which part of the code do I have to eliminate, to keep the date showing between the title and the excerpts?

Thank you very much for your help.

Hello Felix,

To add the date between title and excerpt, please look for this part on the code:

   . '<h3 class="h-recent-posts">' . get_the_title() . '</h3>'
   . $excerpt

Update that to this:

   . '<h3 class="h-recent-posts">' . get_the_title() . '</h3>'
   . '<span class="x-recent-posts-date">' . get_the_date( '', $post->ID ) . '</span>'
     .$excerpt

Please let us know if this helps.

Hello Lely

Thank you very much for your help, this works perfect!

Great Support!

You’re most welcome, Felix.

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