Hi,
on our website we use Podlove with Elementor and the “Elementor Hello” theme.
Elementor has a module to display a list of posts as teasers and add things like an excerpt.
With every other post type, Elementor knows how to display the excerpt with the correct length.
However, if i choose the “episode” post type of Podlove it just shows the entire text of the episode in the excerpt. It doesn’t cut it of.
Here’s an example with the post list where the first post is of a podlove episode post type and the second a regular worpress post.
See the problem? For the regular post the length of the excerpt is as defined in the setting of Elementor. But the podlove episode post type just lists the entire thing as an excerpt.
Is there something with podlove that it doesn’t register it’s excerpts with Wordpress or something like that? Sorry, i’m no developer, so i hope someone in this forum can help.
I found the problem:
Podlove generates it’s own “excerpt” when you fill out the “Zusammenfassung” field in the post backend. Elementor cannot shorten manual excerpts.
I now just need to find a workaround.
Someone at the Elementor Git issue postet a nice workaround that does the trick for now:
opened 05:18PM - 13 Sep 18 UTC
component/posts
product/pro
request/enhancement
<!-- ## BEFORE POSTING YOUR ISSUE
- Please create GitHub issues only for bug… s and feature requests. GitHub issues ARE NOT FOR SUPPORT!
- If you have questions or need general support, Please use: https://wordpress.org/support/plugin/elementor
- For help and support from the Elementor community, see: https://www.facebook.com/groups/Elementors/
- To read more about Elementor, check out our documentation: https://docs.elementor.com
- Developers docs are located at https://developers.elementor.com/
===== Guidelines ====
- Search this repository (top of the page) for the issue, and make sure it has not been fixed or reported before.
- Make sure you are using the most updated versions of Elementor, WordPress & your theme.
- Deactivate all of your plugins. If this solves the problem, gradually activate your plugins one by one, until you spot the problematic plugin.
- Change your WordPress theme to WordPress TwentySixteen (or other default WordPress theme).
- If you're requesting a new feature, explain why you'd like it to be added. Try to add as much detail as you can, and be specific.
-->
## Prerequisites
- [x ] I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
- [x ] The issue still exists against the latest stable version of Elementor.
## Description
<!--
Describe which problem you've encountered. What caused the issue, and what did you expect to happen. Attach screenshots and related links to help us understand the issue in more detail.
Please be as descriptive as possible; issues lacking the below details, or for any other reason than to report a bug, may be closed without action.
-->
On my website, there are posts with excerpts and some without excepts.
In the post widget (elementor pro), the post excerpt length works for the posts that do not have excerpts, but for the posts that have excerpts, it doesn't work and shows the full except.
See screenshot:
![image](https://user-images.githubusercontent.com/5083355/45504280-68050f80-b757-11e8-9912-1ed549d03364.png)
## Steps to reproduce
<!--
For bug reports, list all the steps needed to reproduce your issue, so we can replicate it ourselves.
-->
1. Create posts that have a long excerpt, and some without excerpt.
2. Add a post widget in a page and try to set the excerpt length.
## Isolating the problem
- [x] This bug happens with only Elementor plugin active (and Elementor Pro).
- [x] This bug happens with a default WordPress theme active.
- [x] I can reproduce this bug consistently using the steps above.
## Environment
<details>
<summary>System Info</summary>
```
```
Operating System: | Linux |
-- | -- | --
Software: | Apache |
MySQL version: | 5.6.41 |
PHP Version: | 7.0.31 |
PHP Max Input Vars: | 1000 |
PHP Max Post Size: | 8M |
GD Installed: | Yes |
ZIP Installed: | Yes |
Write Permissions: | All right |
Elementor Library: | Connected
</details>
Put this code into the functions.php :
function summary($content, $limit = 200) {
$content = strip_tags($content);
// Take the existing content and return a subset of it
$end = '';
if (strlen($content) > $limit) {
$end = '...';
}
return substr($content, 0, $limit) . $end;
}
add_action( 'elementor_pro/posts/query/custom_excerpt', function( $query ) {
function trimTitle( $text, $id = null ) {
return summary($text,80);
}
function trimExcerpt( $text, $id = null ) {
return wpautop(summary($text,110));
}
add_filter( 'the_title', 'trimTitle', 10, 2 );
add_filter( 'the_excerpt', 'trimExcerpt', 10, 2 );
} );
And on the page in the Elementor widget use “custom_excerpt” at the field “Query-ID”.
This trims the title to 80 characters and the excerpt to 110 characters. Of course you can set your own limits in the code snippet.
Maybe this helps a few people until Elementor actually addresses the issue.
pablos
July 15, 2024, 5:56pm
4
Lots of stuff uses the excerpts. It would be great to just add the Post Meta Excerpt back in for the Episode Post Type.
1 Like