Site logo

[Support request] Dispatch : problem with category

Home Forums Support [Support request] Dispatch : problem with category

Home Forums Support Dispatch : problem with category

Viewing 12 posts - 31 through 42 (of 42 total)
  • Author
    Posts
  • #2014073
    Nicolas

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

    #2014082
    Elvin
    Staff
    Customer Support

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

    #2014094
    Nicolas

    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

    #2014115
    Elvin
    Staff
    Customer Support

    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?

    #2014137
    Nicolas

    Oh sorry. It’s ok now

    #2014386
    David
    Staff
    Customer Support

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

    https://en-gb.wordpress.org/plugins/advanced-excerpt/

    #2014436
    Nicolas

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

    #2014526
    David
    Staff
    Customer Support

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

    #2014547
    Nicolas

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

    #2016661
    Elvin
    Staff
    Customer Support

    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.

    #2020963
    Nicolas

    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

    #2021275
    David
    Staff
    Customer Support

    Hi there,

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

Viewing 12 posts - 31 through 42 (of 42 total)
  • You must be logged in to reply to this topic.