Site logo

Archived topic

Dispatch : problem with category

41 replies · Started by Nicolas on June 8, 2021

Viewing posts 31–42 of 42

Hi,
On Home page, is it possible to insert a line break in the excerpt text of the blog.
Thanks
Nicolas

Hi 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. :)

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.
Thanks

Thanks.

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?

Oh sorry. It's ok now

Thank you for your reply. I installed and activated the plugin

Did that work ? I cannot see as the site is in maintenance mode ?

No. I have created an access for you. So you can see it.
[User credentials moved to private information text field]

You 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 excerpt

An 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.

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
Nicolas

Hi there,

can you raise a new topic as this new question is unrelated.

This archived topic is closed to new replies.