My current, October 2019, WP set-up is:

Theme: Sempress (with adaptations in a child theme I created)

Plugins:

  • Akismet Anti-Spam
  • Bridgy, for posting to Twitter from my site (and through the Brid.gy service getting back-feed from Twitter and Mastodon). I should be using Syndication Links as a replacement, but haven’t installed that yet.
  • Category to Pages WUD, to add categories to pages, which I use to make my 1-man ‘wiki’
  • Classic Editor, as some of the IndieWeb plugins don’t work with WordPress block structure, so I retain the old posting interface
  • IndieAuth
  • IndieWeb
  • Mastodon Autopost, to post to Mastodon from my site
  • Micropub, to allow me to post to my site using various clients such as Indigenous on my Android
  • Post Kinds, to create different types of postings, including likes, bookmarks etc.
  • Posted Today, to create ‘on this day in …’ lists of my older posts
  • Postie, to post on this site by sending an e-mail
  • Semantic-Linkbacks, to present mentions, likes etc from others in a nicer way
  • Simple Location, allows me to add locations to postings. Don’t actually use it.
  • Ultimate Category Excluder, allows me to keep specific categories on/off the front page, in/out the RSS feed, search or archive overviews. I use this a lot, creating different content streams
  • WebMention, to let other sites know I link to them, to hear from other sites they link to me
  • WebSub, not sure why I’m using it or what it does
  • Widget Context, to keep some widgets off single post pages as they interfere with correct microformats interpretation (machine readability)
  • Wordfence Security
  • Yarns, a microsub server. Not actively in use yet. I’m trying to set-up one of my existing WP test site as my microsub server. As I don’t want all my feed subscriptions in my live site’s WP database. So ideally I have the subscriptions in another site, while interacting with them from this site.

Ten of these plugins are IndieWeb related, and form a collective block of functionality.

I post in three languages on this site: English (mostly), Dutch, German (sometimes).
To better allow language detection I have added mark-up for it in various places. I also add translation links to the RSS feed items that are not in English.

Note: All my non-English posts are in specific categories that provide the language (e.g. nederlands for Dutch, and deutsch for German)

Adaptations made:

Translation links in RSS feed items

In functions.php of my (child)-theme I added (based on this code by Jan Boddez):


add_filter( 'the_content_feed', 'my_content_feed' );
function my_content_feed( $content ) {
	global $post;
$testurl = get_permalink($post);
if ( has_category( 'nederlands', $post->ID)) {
     $basetranslate = 'https://translate.google.com/translate?sl=nl&tl=en&u=';
     $testedurl = urlencode($testurl);
     $basetranslate = $basetranslate.$testedurl;
     $addedlink= '<br/><a href="'.$basetranslate.'">machine translation into English</a><br/>';
     $content = $content.$addedlink;
    }
    
if ( has_category( 'deutsch', $post->ID)) {
     $basetranslate = 'https://translate.google.com/translate?sl=de&tl=en&u=';
     $testedurl = urlencode($testurl);
     $basetranslate = $basetranslate.$testedurl;
     $addedlink= '<br/><a href="'.$basetranslate.'">machine translation into English</a><br/>';
     $content = $content.$addedlink;
    }


	return $content;
}

Setting page wide default language

The function for setting a page wide default considers two cases: when displaying a single post, and when displaying a category archive.
In functions.php of my (child)-theme I added:


function tonsempress_language_attributes($langtoets){
  // ton: if called from single or cat will have right language otherwise default
$langtoets ="en-us";
if (is_single()){
if ( in_category('nederlands') ) {
$langtoets = "nl-nl";}
if ( in_category('deutsch') ) {
$langtoets = "de-de";}
}
if (is_category('nederlands')){$langtoets = "nl-nl";}
if (is_category('deutsch')){$langtoets = "de-de";}
  // return the new language attribute
  return 'lang="'.$langtoets.'"';
}

add_filter('language_attributes', 'tonsempress_language_attributes');

Setting item language on front page

Items on the front page (!) that are in Dutch or German will get a span with their language attribute set accordingly. I changed this in index.php of the child theme, where it considers if a Dutch or German category post is being displayed, in the WordPress Loop:


<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
                    
<?php
	/* Include the Post-Format-specific template for the content.
	* If you want to overload this in a child theme then include a file
	* called content-___.php (where ___ is the Post Format name) and that will be used instead.
	*/
?>	 
<?php /* if in Dutch or German categories, on the homepage added Oct 2019*/?>
	<?php  if ( is_home() ) {
                    if ( in_category( 'nederlands' ) ) { ?><span lang="nl-nl"><?php }
                    if ( in_category( 'deutsch' ) ) { ?><span lang="de-de"><?php }
                    }
						 
                    
	get_template_part( 'content', get_post_format() );

	/* if in Dutch or German categories, on the homepage added Oct 2019*/
		if ( is_home() ) {
                     if ( in_category( 'nederlands' ) ) { ?></span><?php }
                     if ( in_category( 'deutsch' ) ) { ?></span><?php }
                    }
					 	
?>

<?php endwhile; ?>

Why

Webmentions were shown as “Peter mentioned this on ruk.ca”, but that does not provide context for a reader to decide if they want to click to go there. So I want to display a part of the linked item, as a teaser. Years ago pingbacks were presented like that on my site.

What

Find out how webmentions are stored, and how they are presented. Change the presentation by displaying an excerpt.

How

It turned out that webmentions are actually stored in full (so the text of the linked item is available in my wordpress database). It was just that the template for how it got presented needed tweaking. There is also a character count limit, below which a mention is indeed shown as I like it. All this however isn’t done in the theme, but in a plugin, called Semantic Linkbacks and in a specific file: class-linkbacks-handler.php. Once I localised that, I could change what I needed.
So I

  1. changed the character count limit to 500
    // Mentions with content less than this length will be rendered inline.
    define( 'MAX_INLINE_MENTION_LENGTH', 500 );
  2. changed the template for a webmention in public static function get_comment_type_excerpts()
    It was 'mention'=> __( '%1$s mentioned %2$s on href="%3$s">%4$s., 'semantic-linkbacks' )
    I changed it to
    'mention'=> __( '%1$s mentioned %2$s on href="%3$s">%4$s: %5$s', 'semantic-linkbacks' )
    This adds a 5th parameter at the end. This will hold the excerpt.
  3. Then filled that template in, in function public static function comment_text_excerpt
    • After it sets the length of the webmention, stored in $text in $text_len I evaluated that to see if it is longer then the limit. If so it sets a delimiter $text_delim to that maximum, or else sets it to the actual length.
    • Then I create a text snippet from the start of the text to that delimiter $text_snip = substr($text, 0, $text_delim) and add a few dots to the end $text_snip .=" ...."
    • That snippet is then added as 5th parameter to a call of the template mentioned above $text = sprintf( $comment_type_excerpts[ $semantic_linkbacks_type ], get_comment_author_link( $comment->comment_ID ), $post_type, $url, $host, $text_snip);

ToDo

  • This tweak is to a plugin, so the next update will overwrite my changes. Need to figure out how to post it back to the plugin source so it might get incorporated as an option
  • Still need to change how the excerpt is selected. Now it is some 500 characters from the start of a posting. I want it to be 500 characters around the actual link.
  • It seems I need to change webmentions for various types, as a reply to a comment I made is shown as ‘x mentioned y’ (I changed it to the text of the actual comment by hand in this case.)
  • A summary overview of changes I made to this site, to make it more fully a indieweb hub / my core online presence. The set-up of my WordPress installation also has been described.

    Theme related tweaks

    • Created child theme of Sempress, to be able to change appearance and functions
    • Renamed comments to reactions (as they contain likes, reposts, mentions etc.)
      in the entry-footer template and the comments template
    • Removed h-card microformats, and put in a generic link to my about page for the author in the Sempress function sempress_posted_on. Without a link to the author mentions show up as anonymous elsewhere.
    • Removed the sharing buttons I used (although they were GDPR compliant using the Sharriff plugin, but they got in the way a lot I felt.
    • Added a few menu options for various aspects of my postings (books, check-ins, languages)
    • Introduced several categories to deal with different content streams: Dutch, German for non-English postings, Day to Day for things not on the home page, Plazes for check-ins, Books for ehh books, RSS-Only for unlisted postings, and Micromessage for tweets I send from the blog. This allows me to vary how I display these different types of things (or not)

    Functionality related tweaks

    Other tweaks

    • Set up 2 additional WordPress instances for testing purposes (Proto and Meso)