- This topic has 41 replies, 3 voices, and was last updated 3 years, 10 months ago by
David.
-
AuthorPosts
-
November 22, 2021 at 12:29 am #2014073
Nicolas
Hi,
On Home page, is it possible to insert a line break in the excerpt text of the blog.
Thanks
NicolasNovember 22, 2021 at 12:45 am #2014082Elvin
StaffCustomer SupportHi Nicolas,
Can you specify which post list on the home page do you want to add the line break? Also, can you link us to the page in question to check?
Let us know. 🙂
November 22, 2021 at 12:52 am #2014094Nicolas
Yes, here his the link for homepage : https://foyercotedazur.fr/
Under the slider, there is a blog. It’s the first blog of the homepage. I wish I could add a line break just after the date in the text excerpt.
ThanksNovember 22, 2021 at 1:13 am #2014115Elvin
StaffCustomer SupportThanks.
Can you temporarily lift maintenance mode on the site for us to check? Or perhaps provide us temporary backend access to check if from there?
November 22, 2021 at 1:42 am #2014137Nicolas
Oh sorry. It’s ok now
November 22, 2021 at 5:34 am #2014386David
StaffCustomer SupportThat date is in your post content, so it is part of the raw text that WP outputs for the excerpt.
Not easy to fix that. First you would need a plugin like this to output HTML in the post.November 22, 2021 at 6:08 am #2014436Nicolas
Thank you for your reply. I installed and activated the plugin
November 22, 2021 at 7:11 am #2014526David
StaffCustomer SupportDid that work ? I cannot see as the site is in maintenance mode ?
November 22, 2021 at 7:24 am #2014547Nicolas
No. I have created an access for you. So you can see it.
[User credentials moved to private information text field]November 22, 2021 at 7:55 pm #2016661Elvin
StaffCustomer SupportYou may have to modify how you input your date as part of the excerpt.
You can do that by creating a custom field for the date and then filter the excerpt by appending the date and the linebreak before the actual excerpt which will be something like:
>date field value
>linebreak
>the excerptAn example PHP snippet would be something like this: (assuming you have a custom field for date)
add_filter( 'get_the_excerpt', function( $excerpt ) { //example ACF field for excerpt date. $excerpt_date = get_field('excerpt_date', get_the_ID()); if ( has_excerpt( get_the_ID() ) ) { if ( !empty($excerpt_date) ) { $excerpt = $excerpt_date. '<br>' .$excerpt; } } return $excerpt; } );
Note: this may be tedious because you have to edit all of the current manual excerpts you have to remove the dates and fill up the custom fields for the excerpt dates for each posts. But at least after you set this up, you’ll be set for future posts.
November 25, 2021 at 2:01 am #2020963Nicolas
Hello,
I have a problem with adding CSS for the pluggin The events calendar.
None of my changes work.
Is it à problem with GeneratePress ?
Thanks for reply.
Best regards
NicolasNovember 25, 2021 at 5:40 am #2021275David
StaffCustomer SupportHi there,
can you raise a new topic as this new question is unrelated.
-
AuthorPosts
- You must be logged in to reply to this topic.