Tagged: excerpt length, read more
-
AuthorPosts
-
April 29, 2016 at 8:50 pm #624763
Hi,
I would like to decrease the excerpt length and add a “Read More” text (on the text line belove the excerpt – line break ) on this page: http://www.veteranseilas.noI am using the Blog post module to get the post…
Possible?
May 3, 2016 at 4:22 am #626143Hey dalboslampen,
Thank you for using Enfold.
Did you set the “Define Blog Grid layout” of the blog posts element? You can set it to Title and Excerpt + read more link.
Best regards,
IsmaelMay 3, 2016 at 5:03 am #626161Hey dalboslampen,
Please add the below code in your child theme functions.php from Appearance > Editor
Adjust the value 100 to suit your character length in line “return currentText.substr(0, 100);”
The other one is for blog post titles you can change 50 to any number of characters that suits your design well.For more information on child theme please check http://kriesi.at/documentation/enfold/using-a-child-theme/
// Excerpt length function custom_excerpt(){ ?> <script> jQuery(window).load(function(){ jQuery('.post-entry').each(function() { jQuery(".entry-content > p").text(function(index, currentText) { return currentText.substr(0, 100); }); jQuery(".entry-title a").text(function(index, currentText) { return currentText.substr(0, 50); }); }); }); </script> <?php } add_action('wp_head', 'custom_excerpt');
Best regards,
VinnieMarch 27, 2017 at 10:32 pm #767765Hi Vinnie, I just found your solution and applied it but it seems to not work anymore as you can see on my blog.
I copied your code as is in the Child functions.php but I have still very short excerpts for my blog entries :-(
Any tip for me ?
March 29, 2017 at 5:12 pm #768935Hi Dioplr,
You could try 200 or 250 characters here return currentText.substr(0, 100);
If you need further assistance please let us know.
Best regards,
VictoriaJuly 11, 2017 at 6:41 am #819110I have made some changes to get the full word. (not trim the word)
// Excerpt length function custom_excerpt(){ ?> <script> // trim sentence by 22 words function trimByWord(sentence,wordcount = 22) { var result = sentence; var resultArray = result.split(" "); if(resultArray.length > wordcount){ resultArray = resultArray.slice(0, wordcount); result = resultArray.join(" ") + "..."; } return result; } jQuery(window).load(function(){ jQuery('.post-entry').each(function() { jQuery(".entry-content ").text(function(index, currentText) { return trimByWord(currentText); }); jQuery(".entry-title a").text(function(index, currentText) { return trimByWord(currentText,15); // trim title by 15 words }); }); }); </script> <?php } add_action('wp_head', 'custom_excerpt');
Hope it help you all!
BestJuly 11, 2017 at 8:47 am #819160July 21, 2017 at 12:26 pm #825085This doesn’t seem to be working for me using the Avia editor, but does if the post uses the default editor.
I saw that under Screen Options I can enable Excerpt while using the Avia Editor and post text in there but it doesn’t cut it all at whatever amount of charters I set using the code above. It instead post the entire thing in from the Excerpt box.As you know the AVIA editor is way better as I can lay a post how I want better and work in either videos or a gallery way easier.
Ultimately it would be great if the Excerpt could pull right from the AVIA eiditor without having to paste text in a different area, especially when it is the end client doing the post, but I guess a “use as excerpt” option would have to be added to a text block when editing.Either way is there a way to limit the excerpt length automatically when using AVIA like it does with the default editor?
This will help make it way easier plus keep everything looking more even on the main Blog page.
Here is the blog http://www.itsgreektomemn.com/news/
Right now I just pasted the same text for all 3 posts into the Excerpt editor found under screen options, but this way does not limit the excerpt length.Limiting or setting the excerpt length differently on when using the “Latest New” widget on a sidebar or footer would be nice also.
Where 200-250 charters might work great on the main blog page, on a side bar I imagine a lot of people would want to set that closer to 100.Thanks
JonJuly 25, 2017 at 10:14 pm #829823Hi,
Can you please create your own topic, with your details, what yu want to create and how it should work?
We would really appreciate if you can do that for us.Thank you very much
Best regards,
BasilisOctober 4, 2018 at 1:55 pm #1017894Hello
Please, on my website http://www.mairaalgarve.com.br, the blog post element does not display text along with the link read more.
I set the three options and in all displays only read more.Thanks
Catia- This reply was modified 6 years, 1 month ago by catiasilveira.
October 8, 2018 at 2:46 am #1018757Hi,
Are you using the advance layout builder (ALB) for your posts? The content of the ALB will not display on the blog overview page by default. You need to add an excerpt to the posts manually. Edit one of the posts and then enable the “Excerpt” box from the “Screen Options”. The Screen Options is located at the top right corner of the post editor page.
Best regards,
IsmaelNovember 1, 2018 at 9:08 pm #1028948Thanks Ismael
Sorted out.November 2, 2018 at 1:07 pm #1029137 -
AuthorPosts
- The topic ‘Excerpt length and Read more / Blog post display’ is closed to new replies.