At IndieWeb Camp N├╝rnberg today I worked on changing the way my site displays webmentions. Like I wrote earlier, I would like for all webmentions to have a snippet of the linking article, so you get some context to decide if you want to go to that article or not.

It used to be that way in the past with pingbacks, but my webmentions get shown as “Peter mentioned this on ruk.ca”.

After hunting down where in my site this gets determined, I ended up in a file my Semantic Weblinks plugin, called class-linkbacks-handler.php. In this file I altered “get_comment_type_excerpts” function (which sets the template for a webmention), and the function “comment_text_excerpt”, where that template gets filled. I also altered the max length of webmentions that are shown in their entirety. My solution takes a snippet from the start of the webmention. I will later change it to taking a snippet from around the specific place where it links to my site. But at least I succeeded in changing this, and now know where to do that.

When the next update of this plugin takes place I will need to take care, as then my changes will get overwritten. But that too is less important for now.


The webmentions for this posting are now shown as a snippet from the source, below the sentence that was previously the only thing shown.

One reaction on “Wrapping My Head Around Webmentions Pt3

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.