Support » Plugin: Gutenberg Blocks – Ultimate Addons for Gutenberg » Keep HTML in excerpt of UAG-blocks Post grid / Post masonry

  • Resolved Abu Maryam

    (@abu-maryam)


    Hi,

    The Post grid/Post masonry shows the excerpt WITHOUT the html format.
    How can I keep the html format of the post so that it can be shown in the excerpt of the Post grid/Post masonry?

    Regards,
    Abu Maryam

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Team Brainstorm Force

    (@brainstormteam)

    Hey @abu-maryam ,

    Thank you for reaching us out.

    You can do that using a filter. Add this code to your functions.php

    add_filter('uagb_single_post_excerpt_grid', function($excerpt, $id, $attr) {
    	return get_the_content();
    },10, 3 );

    Just replace the uagb_single_post_excerpt_grid with uagb_single_post_excerpt_masonry for Masonry. I hope this resolves your query.

    Regards,
    Vrunda Kansara

    Hi Vrunda,

    the code you have provided WORKS GREAT!!!
    Thank you very much!!!

    There is one thing I noticed about this code:
    – when a post has an embeded video, then the video doesn’t show up in the grid or Masonry. All the other html formats of the post content (like bold text or images) are shown correctly.

    I changed the code a little so the grid/Masonry can also show the embeded videos of the posts.

    CODE:

    add_filter('uagb_single_post_excerpt_grid', function($excerpt, $id, $attr) {
    	return the_content();
    },10, 3 );

    Replace the uagb_single_post_excerpt_grid with uagb_single_post_excerpt_masonry for Masonry.

    Maybe it’s not the correct way, but it works fine.
    Maybe in a future version the UAG-plugin can have also an option to enable/disable show content in the Post grid and Masanry…

    Thanks again!!!
    Abu Maryam

    Plugin Support Team Brainstorm Force

    (@brainstormteam)

    Hey,

    I am glad it worked for you. My team will definitely find some solid solution to this.
    Thank you for reporting this to us.

    We appreciate it.

    Regards,
    Vrunda Kansara

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Keep HTML in excerpt of UAG-blocks Post grid / Post masonry’ is closed to new replies.