• Resolved tkogias

    (@tkogias)


    Hello,

    I have a latest posts block on my home page. I want to preserve HTML tags (really only the anchor tag is what I ‘m after, to show links on excerpts).

    Now, the problem is this: When I select ‘show excerpt’ on the block’s settings, it strips all tags.

    I have installed and activated the plugin but it doesn’t help. Actually, the plugin does take control on category pages (the pages where all posts are shown – with url like https://my-site.com/category/title/) and indeed HTML tags are kept on post excerpts there. However, it has no effect whatsoever on the ‘latest posts’ block output – no HTML tags preserved, no word limit applied – the block’s settings are the only thing that matters, it’s as if the plugin is not even activated.

    I would greatly appreciate any help on this matter – and I hope any clarification will be useful in the future for people having the same problem (as the plugin seems unable to affect ‘latest posts’ block).

    Thanks a lot for your time,

    t.

    • This topic was modified 4 years, 9 months ago by tkogias.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author WPKube

    (@wpkube)

    Hi @tkogias

    The plugin affects index page ( the default homepage, when in Settings > Reading the option “Your homepage displays” is set to “Your latest posts” ), categories and archives.

    It doesn’t work for user made pages ( WP admin > Pages ) since the output of those pages is wrapped in the same WordPress filter as an excerpt output is, so what happens is that the whole page content gets trimmed instead of excerpts that are part of a post content.

    It’s unfortunately a bit of a limitation with WordPress filters so there’s not much we can do about that, but I’ll look into it, perhaps it’s possible to apply a filter directly to the “latest posts” block.

    Thread Starter tkogias

    (@tkogias)

    OK buddy, thanks a lot for your reply and your time.

    I really do believe that such a feature would be useful, as more and more people use blocks there will surely be the need to have more control over the excerpt.

    Allow me to also thank you for a well written and very useful plugin no matter if it couldn’t help me right now, I really appreciate the effort put into open source applications that benefit all of us.

    Plugin Author WPKube

    (@wpkube)

    You’re welcome @tkogias and thank you for the kind words.

    Will be looking into it most likely tomorrow and hopefully will find a solution for the issue. If I do, the update will be released tomorrow.

    @wpkube Has there been an update on this scenario? I have the same situation, where I am using a latest post block on a static home page, and I was hoping your plugin would solve my problem of needing to preserve link and image tags in my post excerpts.

    • This reply was modified 4 years, 9 months ago by jpenaluna.
    Plugin Author WPKube

    (@wpkube)

    Hi,

    I’m really sorry for the wait, I thought I answered this one 2 weeks ago.

    The latest posts block does not apply any filters to the excerpt output so there’s unfortunately no way to modify it.

    Which is a bit weird, WordPress generally has a filter/action that developers can use to modify almost anything.

    The only solution is to use one of the Gutenberg extensions which come with more options. I think Atomic Blocks has a posts listing block with options to change excerpt length.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘unable to affect ‘latest posts’ block ??’ is closed to new replies.