-
AuthorPosts
-
February 18, 2024 at 7:47 am #1434630
nothing in the from works!! newest enfold theme. please help…
February 18, 2024 at 2:17 pm #1434646Hey Christian,
It depends on many factors, try this thread
If this doesn’t help them include a admin login and link to your page so we can examine.Best regards,
MikeFebruary 18, 2024 at 2:40 pm #1434651all that i have tested on masonry!!! is doeswnt work…
thats the site http://relaunch.lichtfilm.com/de/vod/
February 18, 2024 at 2:54 pm #1434653Hi,
Thanks for the link to your page, it looks like each item is showing no words in the excerpt, only a “more” link, your titles show words but the word limits don’t work on titles, perhaps this is why it is not working as you thought.Best regards,
MikeFebruary 18, 2024 at 2:59 pm #1434654i look in the original av-helper-masonry.php and class-avia-mansonry.php and there i found that not the exceprt is used! the $entry->post_content
February 18, 2024 at 3:02 pm #1434655t have testet some code. now the orginal is back
February 18, 2024 at 3:07 pm #1434656Hi,
Now I see there are excerpts showing, so it seems that one of these snippets was working, right?Best regards,
MikeFebruary 18, 2024 at 3:11 pm #1434657there is no shorten the length!
February 18, 2024 at 3:13 pm #1434658only the first and second examples are relevant! where i use the field excerpt
February 18, 2024 at 3:15 pm #1434659This reply has been marked as private.February 18, 2024 at 3:23 pm #1434660Hi,
Please note that this depends on many factors, please fully explanin what you are trying to achieve, are you going to be using manual excerpts on your items? Do you want a read more button? what limit do you want? Some of your items don’t use manual excerpts, so all of your items need to be the same.Best regards,
MikeFebruary 18, 2024 at 3:59 pm #1434662i want shorten the excerpt for manual excerpts
February 18, 2024 at 4:04 pm #1434664February 18, 2024 at 4:06 pm #1434665i want a code for this for the functions file
… so i can change itFebruary 18, 2024 at 4:24 pm #1434667Hi,
I added this to your child theme functions.phpfunction custom_excerpt_setting(){ ?> <script> (function($){ function trimByWord(sentence,wordcount = 10) { var result = sentence; var resultArray = result.split(" "); if(resultArray.length > wordcount){ resultArray = resultArray.slice(0, wordcount); result = resultArray.join(" ") + "..."; } return result; } $(document).ready(function(){ $('.av-masonry-entry-content').each(function() { $(this).text(function(index, currentText) { return trimByWord(currentText); }); }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_excerpt_setting');
please clear your browser cache and check.
Best regards,
MikeFebruary 18, 2024 at 4:34 pm #1434670thanks! that works. Is it possible without javascript?
February 18, 2024 at 4:43 pm #1434672Hi,
Glad that this helped, I didn’t find any other working solution, the manual excerpts are not as easy.Best regards,
MikeFebruary 18, 2024 at 4:45 pm #1434673thanks! have a nice evenning.
February 18, 2024 at 5:01 pm #1434675Hi,
Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘Shorten masonry blogpost excerpt length’ is closed to new replies.