New Landing How can we help? Themeforest Theme Support Joyn Excerpt HTML Stripped

Viewing 12 posts - 1 through 12 (of 12 total)
  • Posted in: Joyn
  • #276021
    heykenneth
    Member
    Post count: 9

    Hoping someone could point me in the right direction. After a recent update to the Swift Framework my custom excerpts on blog posts are no longer retaining their formatting. HTML placed in the Custom Excerpt meta box is being removed and all content is wrapped in a paragraph tag.

    For example on save: <h3>This is a custom header</h3> <h4>Here is the subheader</h4> Becomes: <p>This is a custom header Here is the subheader</p>

    Any ideas? Thanks!

    #276390
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    It is correct because HTML content output damage the layout. So we use plain text wrap with only P tag.
    Thanks
    Mohammad

    #276399
    heykenneth
    Member
    Post count: 9

    Mohammad, how come this worked prior to the latest Swift Framework update? Why would non-paragraph tags damage the layout? You’ve provided a Custom Excerpt meta input box which previously accepted HTML markup.

    Is it possible to turn this functionality back on and stop the HTML tags from being stripped? Thanks!

    #276404
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Are you using the Blog element of Swift page builder to display the blog posts?
    Thanks
    Mohammad

    #276483
    heykenneth
    Member
    Post count: 9

    Mohammad, yes I’m using the Swift Page Builder Blog element and then a Recent Post module from the Page Builder as well. I have custom text I’m trying to display in a specific format via the Custom Excerpt meta box. Appreciate your help on this.

    #276660
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    Unfortunately only plain text is supported as a post excerpt

    – Kyle

    #276789
    heykenneth
    Member
    Post count: 9
    This reply has been marked as private.
    #276864
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Ok I will forward this to the developer for you to see if anything has changed

    – Kyle

    #277086
    heykenneth
    Member
    Post count: 9

    Thank you very much!

    #277456
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    Can you link me to the post you are trying to do this on and also add a WP login?

    Thanks.

    #277493
    heykenneth
    Member
    Post count: 9

    David,

    I was able to resolve this, but admittedly it seems like a bit of hack. In a more recent version of the Swift Framework:

    
    function sf_custom_excerpt( $custom_content, $limit ) {
            $content = explode( ' ', $custom_content, $limit );
    

    Was changed to:

    
    function sf_custom_excerpt( $custom_content, $limit ) {
            $content = wp_trim_words( $custom_content, $limit );
    

    Form some reason wp_trim_words strips the HTML content in the Custom Excerpt where as explode leaves it intact. It would be great to understand why the change. Also, would love to do this via a function in functions.php instead of overwriting the core files. Initially I was looking at updating the_excerpt() to allow for specific HTML tags, until I realized you are using your own custom excerpts.

    Thank you!

    #277500
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    Great, this is what I was going to refer you to, the trouble is as you discovered those functions cannot be overridden currently in a child theme.

    I’m going to feedback to Ed (lead dev) to see if we can get this added so we can override this going forward.

    Cheers,
    David.

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register