I’ve documented and written about it quite a bit in the past and am obviously a big fan. In addition to most of the default post types (notes, favorites, likes, bookmarks, reads, listens, etc.), my personal site also supports follows, eat, drink, wishes, acquisitions, exercise, and chickens! Wait a second… CHICKENS?!?
Yes, that’s chickens, not checkins, which I also support.
One of the nice benefits of the plugin is that it’s fantastically modular and extensible. As an exercise a few months back I thought I would take a shot at adding chicken post support to my website. Several years ago in the IndieWeb, partly as an educational exercise and partly for fun, several people thought it would be nice to add a post type of “chicken” to their sites. What would it look like? What would it entail? How might it evolve? Since then interest in chicken related posts has naturally waned, but it does bring up some interesting ideas about potential new pieces of functionality that one might want to have on their personal websites.
While I currently support many post types, I’ve discovered recently that I have a variety of notes and checkins that relate to items I’ve purchased or acquired. I thought it might be worthwhile to better keep track on my own website of things I acquired in a more explicit way to make posting them and searching for them a lot easier. But how could I do this myself and potentially contribute it back to a broader base of other users? I started with a bit of research on how others have done this in the past and tried to document a lot of it on the Indieweb wiki. I eventually asked David Shanske to reserve the idea of acquisitions within the Post Kinds plugin, which he did, but I wondered how I might have done some of that work myself.
So below, as an example, I thought I’d write up how I’ve managed to add Chicken posts to my website. To a great extent, I’m using data fields and pieces already built into the main plugin, but in doing this and experimenting around a bit I thought I could continue to refine chicken posts until they did what I wanted, after which, I could do a pull request to the main plugin and add support for others who might want it. Hopefully the code below will give people a better idea about how the internals of the plugin work so that if they want to add their own pieces to their sites or contribute back to the plugin, things might be a tad easier.
Pieces for a new Post Kind in WordPress
Adding a new Post Kind primarily consists of three broad pieces which I’ll address below. The modularity of the plugin makes adding most of the internals for a new kind far simpler than one might imagine.
Adding Taxonomy Support
New kinds in general will require a small handful of properties which include:
- a name (as well as its singular, plural, and verb forms);
- a microformats 2 property;
- a format, so that the plugin can map the new post kind to a particular Post Format type within WordPress core so that themes which use these can be properly set when needed. Format options include: aside, image, video, quote, link, gallery, status, audio, and chat. Some post kinds may not have an obvious mapping, in which case the value can be left as empty;
- a generic description for display within the admin user interface as well as for the archive pages for the type which are auto-generated;
- a description-url, typically this is a link to the IndieWeb wiki that has examples and details for the particular post kind. If there isn’t one, you could easily create it and self-document your new use case. It could even be empty if necessary;
- A show setting with a value of true or false to tell the plugin to default to showing the kind in the Post Kinds “Kinds” metabox so that the new kind will show up and be choose-able from within the interface when creating new posts.
Code to include these pieces of data will need to be added to the /includes/class-kind-taxonomy.php folder/file path within the plugin so that the plugin knows where it needs to be found.
As an example, here’s what the code looks like for the bookmark kind:
'bookmark' => array( 'singular_name' => __( 'Bookmark', 'indieweb-post-kinds' ), // Name for one instance of the kind 'name' => __( 'Bookmarks', 'indieweb-post-kinds' ), // General name for the kind plural 'verb' => __( 'Bookmarked', 'indieweb-post-kinds' ), // The string for the verb or action (liked this) 'property' => 'bookmark-of', // microformats 2 property 'format' => 'link', // Post Format that maps to this 'description' => __( 'storing a link/bookmark for personal use or sharing with others', 'indieweb-post-kinds' ), 'description-url' => 'http://indieweb.org/bookmark', 'show' => true, // Show in Settings ),
For direct comparison, and as an explicit example for my chicken post kind, here’s the block of code I inserted within the class-kind-taxonomy.php file immediately below the section for the acquisition type:
'chicken' => array( 'singular_name' => __( 'Chicken', 'indieweb-post-kinds' ), // Name for one instance of the kind 'name' => __( 'Chickens', 'indieweb-post-kinds' ), // General name for the kind plural 'verb' => __( 'Chickened', 'indieweb-post-kinds' ), // The string for the verb or action (liked this) 'property' => 'chicken-of', // microformats 2 property 'format' => 'image', // Post Format that maps to this 'description' => __( 'Owning all the chickens. Welcome to my chicken feed.', 'indieweb-post-kinds' ), 'description-url' => 'https://indieweb.org/chicken', 'show' => true, // Show in Settings ),
You’ll probably notice that beyond the simple cut and paste, I haven’t really changed much. Syntax aside, most of these pieces are relatively obvious and very straightforward, but I’ll add some commentary about a few parts and what they do which may not be as obvious to the beginner. When creating your own you can copy and paste this same block into the code at the bottom of the list of other types, but you’ll want to change only the data that appears within the single quotes on each of the nine lines for the various settings.
For those not familiar with microformats you may be asking yourself what snippet to add for the property setting. The best bet is to take a look at the microformats wiki or look for possible examples of people doing the same type of post you’re doing and copy their recommended microformat. For extremely new and likely experimental edge cases, chances are that you’ll need to choose your own experimental microformat name. In these instances you can use prior microformats as examples and potentially follow the format. In my case I knew about the bookmark-of, like-of, favorite-of, and the experimental read-of, listen-of, and watch-of microformats, so I followed the pattern and chose chicken-of for my experimental chicken posts. One could also potentially ask for recommendations within either the microformats IRC/chat channel or the IndieWeb chat. If you create a new and experimental one, take a few moments to document your use case in the IndieWeb and/or Microformats wikis for others who come after you. Keep in mind that if you change the property name at a later date you will need to go into your database and change the wp_postmeta database meta_key field from mf2_property1 to mft_property2 so that WordPress will know where the appropriate data is stored to be able to display it.

show is set to trueThe show setting is fairly straightforward, but may not be as obvious to some. It has either a value of true or false. If the value is false, the new post kind won’t be displayed in the radio button options within the admin UI for creating new posts. If the value is true, then it will be available. The Post Kinds plugin has a number of reserved post kinds which aren’t displayed by default on most sites–primarily because they do not have appropriate views or data fields defined–but they could be enabled by changing the show flag from false to true. Most often we recommend you only show those kinds that you’re actively using.
Additional examples of the dozen or more standard post kinds can be found within the code to provide some additional potential clarity on what types of data each of them are expecting.
I debated a while on making the verb ‘chickened out’ instead of ‘chickened,’ but I chickened out thinking that it would make my posts something wholly different. Obviously you can now make your own choice.
With this chunk of code saved into the plugin, it is now generally aware of the new post kind and can save the appropriate data for this new kind of post.
Template/View Support
Now you’ll want to add some code to the plugin to tell the plugin how it should display the data it’s saving for your posts. The easiest way to do this is to copy and paste the code from one of the many default views already in the plugin and just change a few small pieces of data to match your post kind. This code can be created as a new file with your new matching post kind name (the one at the top of your code snippet above that appears on line 1 before the word ‘array’) in one of two places. If you put it in the views folder in the plugin, you may need to re-add it later on if the plugin updates. Otherwise you can add the code into a file which can be placed into a folder named kind_views in either the folder for your theme (or your child theme, if you have one.) We recommend placing it in your child theme, so if the parent theme updates, your code won’t accidentally be lost.
There are a variety of views for many post kinds available to stand as examples, so you can look at any of these and tweak them as you wish to get the output you desire. For more complicated output displays it might certainly help to have some PHP coding skills. For my chicken post kind I simply copied and pasted the code for the bookmark kind view and pasted it into a file named kind-chicken.php following the naming convention of the other files.
Below is a copy of the code I added for the chicken post kind which is nearly identical to the bookmark view with exception of changing the name of the template, adding u-chicken-of and changing the get_before_kind to chicken instead of bookmark. Note that because the chicken-of microformat is wrapped on a URL, it has the u- prefix, otherwise if it were on plain text it would have been p-chicken-of using the standard microformat h-, u-, p-, and e- syntax.
I also put both the u-chicken-of and the u-bookmark-of microformats in the view so that sites using the post type discovery algorithm that don’t recognize the chicken-of microformat won’t choke on the proverbial chicken bone, but will default back to thinking this post is of the bookmark type. I suspect that I could also have left the u-bookmark-of off and many would have defaulted to thinking this post was a simple note as well. You can make your own choice as to which you prefer as a default.
<?php
/*
* Chicken Template
*
*/
$mf2_post = new MF2_Post( get_the_ID() );
$cite = $mf2_post->fetch();
if ( ! $cite ) {
return;
}
$author = Kind_View::get_hcard( ifset( $cite['author'] ) );
$url = ifset( $cite['url'] );
$embed = self::get_embed( $url );
?>
<section class="response u-chicken-of h-cite">
<header>
<?php
echo Kind_Taxonomy::get_before_kind( 'chicken' );
if ( ! $embed ) {
if ( ! array_key_exists( 'name', $cite ) ) {
$cite['name'] = self::get_post_type_string( $url );
}
if ( isset( $url ) ) {
echo sprintf( '<a href="%1s" class="p-name u-url">%2s</a>', $url, $cite['name'] );
} else {
echo sprintf( '<span class="p-name">%1s</span>', $cite['name'] );
}
if ( $author ) {
echo ' ' . __( 'by', 'indieweb-post-kinds' ) . ' ' . $author;
}
if ( array_key_exists( 'publication', $cite ) ) {
echo sprintf( ' <em>(<span class="p-publication">%1s</span>)</em>', $cite['publication'] );
}
}
?>
</header>
<?php
if ( $cite ) {
if ( $embed ) {
echo sprintf( '<blockquote class="e-summary">%1s</blockquote>', $embed );
} elseif ( array_key_exists( 'summary', $cite ) ) {
echo sprintf( '<blockquote class="e-summary">%1s</blockquote>', $cite['summary'] );
}
}
// Close Response
?>
</section>
<?php
Icon Support
Finally, you’ll want to include the appropriate svg icon within the plugin so that it will display on the post (if the appropriate settings are chosen within the plugin’s settings interface: either “icon” or “icon and text”), and within the Kinds metabox in the post editor.
You’ll want to have one icon named kindname.svg in the svgs folder and another named kinds.svg in the plugin’s root folder. The kinds.svg is a special ‘master’ svg of all of the kinds icons bundled together. If it helps in matching the icon set, all of the current kind icons are made with Font Awesome icons which have the appropriate licensing for distribution.
In my chicken example, I opted for the feather icon since Font Awesome didn’t have an actual chicken available.
When you’re done
Thanks to the rest of the plugin’s functionality, you should now automatically be able able to make and display individual chicken posts, display a chicken feed (pun intended), and allow people to subscribe to the RSS feed of your chicken posts.
Creating a plugin for new kinds
Naturally some people may want to display particular exotic kinds which might not extend to the broader public. A chicken post type certainly falls under this umbrella as I wouldn’t expect that other than for novelty, obsessive IndieWeb post kinds completeness, or for a very small handful of specialized farming, juggling, or comedy websites that anyone else in their right mind would really want to be doing a lot of posting about chickens on their site.
David Shanske, the plugin’s creator, has made it possible to create a sub-plugin of sorts so that one can add one-off support to these types using a variety of filters and functions. This could be useful so that updates to the plugin don’t overwrite one’s work and require adding the pieces outlined above back in again. Sadly, this is a tad beyond my present abilities, so I won’t address it further at the moment other than to say that it’s possible and perhaps someone might document it for others to use a similar template in the future.
Try it yourself
Now that you’ve got the basics, it should be relatively easy to add many of your own new post kinds.
Exercise One
If you want a simple exercise, you should be able to go into the code and manually change the show flags for the eat and drink kinds from their default false to true to enable posting food to create a food diary on your website. (These have a reasonable default view and icons already built in.)
Exercise Two
With slightly more work you can change the show flag on the follow kind and copy a view based on the bookmark view to make a follow view to make follow posts. (Here’s a link to my version.) Similarly other hidden kinds like wishes and acquisitions can be enabled easily as well. These also have default icons already built in, but just need a view defined to show their data.
Exercise Three
If you want a slightly larger challenge that uses all of the above, why not attempt adding the appropriate machinery to create a want post?
Exercise Four
Though David has often said before that he wouldn’t build in support for multi-kinds, some people may still want them or think they need them. If you’re exceptionally clever, you might be able to create your own explicit multi-kind by mixing up the details above and creating a kind that mixes a variety of the details and creates a view that would allow the specific multi-kind you desire. Caveat emptor on this approach if you should take it.
Share your ideas
Now that you’ve got the general method, what kinds are you going to deploy in the future? What have you already created? Feel free to reply with your ideas and thoughts below in the comment section or send us a webmention from your own site with what you’ve done. Maybe consider doing a pull request on the plugin itself to add the functionality for others?
Thank you so much Chris for the write-up. Now to find some time to create a newspaper post kind. I am interested in the idea of post kinds possibly triggering certain POSSE actions.
Manually adding a new post kind to the Post Kinds Plugin for WordPress
<a href="https://bookmarks.jgregorymcverry.com/tag/WordPress">#WordPress</a>
#WordPressTheme
#MicroFormats
Syndicated copies:
Really love this idea of Manually adding a new post kind to the Post Kinds Plugin for WordPress.
I’ve already enabled the following post kinds: acquisition, drink, eat, exercise, sleep and trip. Multi-kind posts is something I really want to do though it is not supported. Though I cheated a bit by enabling the Quick Edit option in the plugin and then using the The Quick Edit option in WordPress to add the additional post kind.
Using Quick Edit in this way is clever! I might try that too.
Now you can have richer reply contexts on your posts in WordPress
Syndicated copies:
Chris, when I have some free time, I think I’ll add a beer kind to use with my Untappd activity.
Replied to a post by Serena (Serena Who?)
@vishae Wishes are already built into the core version of Post Kinds, so it shouldn’t take much work, but you’ll need to make a few changes. I’ve written before about the generalization of how to do this. You’ll need to dip into the code here to change the show value from
falsetotrue. (Hint: on your admin dashboard visit:/wp-admin/plugin-editor.php?file=indieweb-post-kinds%2Fincludes%2Fclass-kind-taxonomy.php&plugin=indieweb-post-kinds%2Findieweb-post-kinds.php). Then save the file. There’s already a reasonable template built into the plugin, so you shouldn’t need to make your own.The plugin will generally import a “featured image” if one is available on the page you’re bookmarking, but it doesn’t yet have functionality for showing it yet. I often I add one manually myself by cutting and pasting the URL for the photo the plugin returns and put it into the External URL featured image plugin. (Eventually when Post Kinds handles featured images, I should be able to turn the plugin off so it doesn’t duplicate the data.)
Syndicated copies to:
Syndicated copies:
Replied to a post by Serena (Serena Who?)
@vishae Wishes are already built into the core version of Post Kinds, so it shouldn’t take much work, but you’ll need to make a few changes. I’ve written before about the generalization of how to do this. You’ll need to dip into the code here to change the show value from
falsetotrue. (Hint: on your admin dashboard visit:/wp-admin/plugin-editor.php?file=indieweb-post-kinds%2Fincludes%2Fclass-kind-taxonomy.php&plugin=indieweb-post-kinds%2Findieweb-post-kinds.php). Then save the file. There’s already a reasonable template built into the plugin, so you shouldn’t need to make your own.The plugin will generally import a “featured image” if one is available on the page you’re bookmarking, but it doesn’t yet have functionality for showing it yet. I often I add one manually myself by cutting and pasting the URL for the photo the plugin returns and put it into the External URL featured image plugin. (Eventually when Post Kinds handles featured images, I should be able to turn the plugin off so it doesn’t duplicate the data.)
Syndicated copies to:
Syndicated copies:
I used to have problem controlling my impulse buys; when a new fountain pen ink comes out, I click buy, a new washi tape that I found, buy, some new gadget/doodad that I saw a review of, buy.
Most of the time, I did this because I had no centralised way of saving my wishlist for later. Instead of possibly losing track of the website or having the item lost under a pile of other similar items in an Amazon search, I just added it to my checkout basket.
It’s true that websites like Amazon or eBay have their favourites or wishlist feature, but how do you remember a small online scrapbook suppliers store you found through Google images?
When Pinterest came out, it was a god send. Instead of impulsing buying every thing that took my fancy, I just pinned it.
I had Pinterest boards of online classes I wanted to take, clothes I wanted to buy, fountain pens that people are raving about.
Immediately, my desire for buying half the stuff I pinned faded; these items were recorded somewhere else, safe from the leaky memory of my meat brain. I can review these items at my leisure, and not be pressured by my desire to reduce the number of open tabs I have in my browser.
Also, by having categorised wishlist boards, I can easily compare items across different websites – just how many polka dot washi tape did I really need?
Of course, in keeping with not relying on social media silos, I’m thinking of pinning my Wishlist items to my blog instead.
Wish would be the perfect post kind for this, and thanks to Chris Aldrich (@(c)), I was able to set that up without much problem.
So heads up, they’ll be a few wish posts popping up on the micro.blog timeline very soon.
I was taken with Ian O’Byrne’s righteous excitement in his video the other day over the realization that he could potentially own his online annotations using Hypothesis, that I thought I’d take a moment to outline a few methods I’ve used.
There are certainly variations of ways for attempting to own one’s own annotations using Hypothesis and syndicating them to one’s website (via a PESOS workflow), but I thought I’d outline the quickest version I’m aware of that requires little to no programming or code, but also allows some relatively pretty results. While some of the portions below are WordPress specific, there’s certainly no reason they couldn’t be implemented for other systems.
Saving individual annotations one at a time
Here’s an easy method for taking each individual annotation you create on Hypothesis and quickly porting it to your site:
Create an IFTTT.com recipe to port your Hypothesis RSS feed into WordPress posts. Generally chose an “If RSS, then WordPress” setup and use the following data to build the recipe:
Input feed:
https://hypothes.is/stream.atom?user=username(change username to your user name)Optional title:
📑 {{EntryTitle}}Body:
{{EntryContent}} from {{EntryUrl}} <br />{{EntryPublished}}Categories: Highlight (use whatever categories you prefer, but be aware they’ll apply to all your future posts from this feed)
Tags: hypothes.is
Post status (optional): I set mine to “Draft” so I have the option to keep it privately or to publish it publicly at a later date.
Modify any of the above fields as necessary for your needs. IFTTT.com usually polls your feed every 10-15 minutes. You can usually pretty quickly take this data and turn it into your post kind of preference–suggestions include read, bookmark, like, favorite, or even reply. Add additional categories, tags, or other metadata as necessary for easier searching at a later time.
Here’s an example of one on my website that uses this method. I’ve obviously created a custom highlight post kind of my own for more specific presentation as well as microformats markup.
A highlight from Hypothesis posted on my own website using some customized code to create a “Highlight post” using the Post Kinds Plugin.
Aggregating lots of annotations on a single page
If you do a lot of annotations on Hypothesis and prefer to create a bookmark or read post that aggregates all of your annotations on a given post, the quickest way I’ve seen on WordPress to export your data is to use the Hypothesis Aggregator plugin [GitHub].
Create a tag “key” for a particular article by creating an acronym from the article title followed by the date and then the author’s initials. This will allow you to quickly conglomerate all the annotations for a particular article or web page. As an example for this article I’d use:
OUHOAH062218CA. In addition to any other necessary tags, I’ll tag each of my annotations on the particular article with this somewhat random, yet specific key for which there are unlikely to be any other similar tags in my account.Create a bookmark, read, reply or other post kind to which you’ll attach your annotations. I often use a bookmarklet for speed here.
Use the Hypothesis Aggregator’s short code for your tag and username to pull your annotations for the particular tag. It will look like this:
[hypothesis user = 'username' tags = 'tagname']If you’re clever, you could include this shortcode in the body of your IFTTT recipe (if you’re using drafts) and simply change the tag name to the appropriate one to save half a step or need to remember the shortcode format each time.
If you’re worried that Hypothes.is may eventually shut down, the plugin quits working (leaving you with ugly short codes in your post) or all of the above, you can add the following steps as a quick work-around.
Input the shortcode as above, click on the “Preview” button in WordPress’s Publish meta box which will open a new window and let you view your post.
Copy the preview of the annotations you’d like to keep in your post and paste them over your shortcode in the Visual editor tab on your draft post. (This will maintain the simple HTML formatting tags, which you can also edit or supplement if you like.)
I also strip out the additional unnecessary data from Hypothesis Aggregator about the article it’s from as well as the line about who created the annotation which isn’t necessary as my post will implicitly have that data. Depending on how you make your post (i.e. not using the Post Kinds Plugin), you may want to keep it.
As Greg McVerry kindly points out, Jon Udell has created a simple web-tool for inputting a few bits of data about a set of annotations to export them variously in HTML, CSV, or JSON format. If you’re not a developer and don’t want to fuss with Hypothesis’ API, this is also a reasonably solid method of quickly exporting subsections of your annotations and cutting and pasting them onto your website. It does export a lot more data that one might want for their site and could require some additional clean up, particularly in HTML format.
Perhaps with some elbow grease and coding skill, sometime in the future, we’ll have a simple way to implement a POSSE workflow that will allow you to post your annotations to your own website and syndicate them to services like Hypothesis. In the erstwhile, hopefully this will help close a little of the data gap for those using their websites as their commonplace books or digital notebooks.
Syndicated copies:
Bookmarked Manually adding a new post kind to the Post Kinds Plugin for WordPress by Chris Aldrich (BoffoSocko)
I want to create a new post kind for new music (CDs and records) that I buy.
I want to create a new post kind for new music (CDs and records) that I buy.
Test
Some time ago I created a Zapier workflow to create posts from my Untappd drinking activity. The Zapier workflows create a post (article post kind) with a featured image, some facts about the ale and the brewery, with a small bit of commentary text. You can see an example at this entry for Claim Preclusion by Troon Brewing.
Ryan Barrett tracks his ale drinking via a single page which I think he manually updates. I don’t think he’s created individual post entries for the items on the list. My Zapier workflow updates a Google spreadsheet with data points for each of the ales I drink. Perhaps sometime in the future, I’ll find a way to use that information to create a beer post.
However, I have had one persistent issue with the Zapier workflow that I have not been able to resolve even while working with Zapier’s tech support. All the Zapier’s entries are created with an offset of -4 hours form EST. So lunchtime entries show up at 8 AM which makes it seems like I have a beer for breakfast.
After reading Chris Aldrich’s post about manually adding a new post kind to the Post Kinds plugin for WordPress, I wanted to create a post kind for beer check-ins.
I followed Chris’s suggestion and proceeded to edit the
/includes/class-kind-taxonomy.phpfile. But I soon discovered that a post kind for a drink already existed. There was also one for eating. The show flag was set to false. Setting it to true enabled it in the Indieweb Post Kinds admin GUI. I edited some of my existing drinking posts, changed the post kind to drink, filled in the requisite fields and updated the posts.I also manually changed the show flags for the eat, acquisition, recipe and exercise kinds from their default false to true. I plan on setting the post kinds some of my existing recipe entries from article to recipe.
The way things are displayed functional but there are several visual and data capture issues.
If I use the URL of the Untappd entry for the craft ale as the URL for the post, then when the Indieweb Post Kinds plugin retrieves the information for the Untappd entry, only summary is provided, e.g. Reusable Bags brewed by Troon Brewing as an IPA – Imperial / Double style beer, which has 4.4 out of 5, with 197 ratings and reviews on Untappd, for the ale and inserted into the summary text for the post. I would prefer that if the summary was of my rating. You can see examples for the entries for Hazy, Hot, & Humid by Flounder Brewing Co. and Reusable Bags by Troon Brewing.
My short commentary about the beer is not pulled from Untappd.
The brewery notes are not part of the information returned from Untappd. I would love to keep that information on my website.
If I use the URL of my Untappd checkin, the only information pulled back is the fact that I drank that ale, e.g. Khürt is drinking a Hunger Pangs by Troon Brewing at Brick Farm Tavern. The post entry for [Hunger Pangs by Troon Brewing](for https://islandinthenet.com/troon-brewings-hunger-pangs-2/) is as an example of that.
The icon for a drink is a coffee cup. To me that suggestion coffee. Not beer, wine, or even water. It seems odd to have that icon. I don’t know how to change it to something more generic. If I wanted to create a post kind specifically for drinking beer, I could do it but I wouldn’t know how to change or set the icons.
The syndication icon for Untappd is just a black circle. Apparently, there are no icons in whatever icon set is being used by the Post Kinds plugin. I don’t know how to change that either.
All of the other information for the post kind was entered manually. If I am out at a restaurant or bar, I will have to check-in via Untappd, wait for the Zapier workflow to create the post entry, copy the URL for the Untappd check-in, edit the WordPress post, change the post kind to drink, set the brewery name and URL manually, set the syndication link manually, and then update the post. Whew!
It would be awesome if I could figure out a way to populate all that information with a browser bookmarklet. Beer drinking for me is a social event. When I’m out in a restaurant or bar with friends taking a few minutes to use Untappd to check into a new craft ale is acceptable. It is not acceptable to spend 15 minutes fiddling with the screen on my iPhone to put all the pieces in place.
Despite all of that I created the post kind manually.
'beer' => array(
'singular_name' => __( ‘Beer’, 'indieweb-post-kinds' ), // Name for one instance of the kind
'name' => __( ‘Beers’, 'indieweb-post-kinds' ), // General name for the kind plural
'verb' => __( 'Drank', 'indieweb-post-kinds' ), // The string for the verb or action (liked this)
'property' => 'food', // microformats 2 property
'format' => 'standard', // Post Format that maps to this
'description' => __( 'Prost!', 'indieweb-post-kinds' ),
'description-url' => 'https://indieweb.org/food',
'title' => true, // Should this kind have an explicit title
'show' => true, // Show in Settings
),
See an example of it working with the post entry for Frightened Rabbit by Troon Brewing.
I found a beer mug icon on Font Awesome and placed it in the appropriate folders. However, I must be doing something wrong. No icon appeared in the response section of my entries or in Indie Post Kinds admin UI. What am I doing wrong?
Chris suggested creating a custom view but I honestly don’t understand if this is required or optional and why it’s needed. He lost me at:
I have seen no difference in how any of the package post types are display in WordPress. Perhaps there is something subtle that I am missing.
Time for a break. I am headed over to the Brick Farm Tavern to see if the newest ale from my favourite craft ale brewery is on tap.
Syndicated copies:
Hi Chris, I’m trying to create a “beer” post- kind for my Untappd activity. I followed along and got something working but didn’t understand the “Template/View Support” section and can’t seem to get a working icon. Can you steer me in the right direction to get this working?
Chances are that the icons are fine, you jyst need to do a version bump on the plugin to get the internal cache to flush to show them.
Webmentions and pingbacks may not be working at all on my website. My Webmention reply to this post did not appear here.
https://islandinthenet.com/2018-09-09-08-08-19/
I had almost forgotten that it was not so long ago that I’d outlined how I use Hypothesis to own my own highlights and annotations on my website. For the benefit of those in Dr. McVerry’s EDU522 course, I’ve included a link to it here.
For those who would like to see some examples you can find several below:
Specific stand-alone highlight posts
Specific stand-alone annotation posts
Other posts (typically reads) which I’ve highlighted and/or otherwise annotated things
I created the stand-alone posts using customized post kinds using some custom code for the Post Kinds Plugin.
I’ll begin tagging some of these pieces with the tag “backstage” for those in the EDU522 class that wish to follow along with how I’ve built or done certain things. You can subscribe to these future posts by adding
/feed/to the end of the URL for this tag archive.To some extent my IndieWeb Collection/Research page has a lot of these “backstage” type posts for those who are interested. As part of the IndieWeb community, I’ve been documenting how and what I’ve been doing on my site for a while, hopefully these backstage posts will help other educators follow in my path without need to blaze as much of it anew for themselves.
Backstage posts are in actuality a very IndieWeb thing:
Syndicated copies to: WordPress icon
2018-09-09 08.08.19
I just don’t understand what the following means.
You’ll want to have one icon named kindname.svg in the svgs folder and another named kinds.svg in the plugin’s root folder. The kinds.svg is a special ‘master’ svg of all of the kinds icons bundled together. If it helps in matching the icon set, all of the current kind icons are made with Font Awesome icons which have the appropriate licensing for distribution.
I downloaded and place a Font Awesome icon called ‘beer.svg’ into the svgs folder. However, the kinds.svg file already existed in the plugin’s root folder. The kinds.svg file does not apparently have all of the kinds icons bundled together since beer.svg is not in that file (it’s a binary file). I really don’t understand how this worked for you but not me. There must be a step I am missing.
You should be able to open up the kinds.svg file in a text editor and you’ll see chunks of text in .xml format. In skimming through it you’ll notice there are chucks of “code” for each of the respective kinds. You should be able to open up the beer.svg file and cut and paste in the appropriate code for the beer icon into the kinds.svg file. (You may have to tweak small parts so that it follows the format of the rest of kinds which you can use as examples.) Doing a version bump of the plugin will force WordPress’ admin cache to flush and cause the plugin to display the new icon. Otherwise, you can usually wait a few days and it should auto-flush and show the icon(s) you expect. If you’re hard-pressed, let me know and I’ll try to generate one for you.
Thansk for your offer of help Chris.
The beer.svg contains
The kinds.svg looks like this (there are NO spaces).
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><symbol viewBox="-200 -200 1040 912" id="acquisition" xmlns="http://www.w3.org/2000/svg"><path d="M204.8 230.4c-10.6-14.1-30.7-17-44.8-6.4-14.1 10.6-17 30.7-6.4 44.8l38.1 50.8c4.8 6.4 4.1 15.3-1.5 20.9l-12.8 12.8c-6.7 6.7-17.6 6.2-23.6-1.1L64 244.4V96c0-17.7-14.3-32-32-32S0 78.3 0 96v218.4c0 10.9 3.7 21.5 10.5 30l104.1 134.3c5 6.5 8.4 13.9 10.4 21.7 1.8 6.9 8.1 11.6 15.3 11.6H272c8.8 0 16-7.2 16-16V384c0-27.7-9-54.6-25.6-76.8l-57.6-76.8zM608 64c-17.7 0-32 14.3-32 32v148.4l-89.8 107.8c-6 7.2-17 7.7-23.6 1.1l-12.8-12.8c-5.6-5.6-6.3-14.5-1.5-20.9l38.1-50.8c10.6-14.1 7.7-34.2-6.4-44.8-14.1-10.6-34.2-7.7-44.8 6.4l-57.6 76.8C361 329.4 352 356.3 352 384v112c0 8.8 7.2 16 16 16h131.7c7.1 0 13.5-4.7 15.3-11.6 2-7.8 5.4-15.2 10.4-21.7l104.1-134.3c6.8-8.5 10.5-19.1 10.5-30V96c0-17.7-14.3-32-32-32z"/></symbol><symbol viewBox="-180 -180 936 872" id="article" xmlns="http://www.w3.org/2000/svg"><path d="M552 64H112c-20.858 0-38.643 13.377-45.248 32H24c-13.255 0-24 10.745-24 24v272c0 30.928 25.072 56 56 56h496c13.255 0 24-10.745 24-24V88c0-13.255-10.745-24-24-24zM48 392V144h16v248c0 4.411-3.589 8-8 8s-8-3.589-8-8zm480 8H111.422c.374-2.614.578-5.283.578-8V112h416v288zM172 280h136c6.627 0 12-5.373 12-12v-96c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v96c0 6.627 5.373 12 12 12zm28-80h80v40h-80v-40zm-40 140v-24c0-6.627 5.373-12 12-12h136c6.627 0 12 5.373 12 12v24c0 6.627-5.373 12-12 12H172c-6.627 0-12-5.373-12-12zm192 0v-24c0-6.627 5.373-12 12-12h104c6.627 0 12 5.373 12 12v24c0 6.627-5.373 12-12 12H364c-6.627 0-12-5.373-12-12zm0-144v-24c0-6.627 5.373-12 12-12h104c6.627 0 12 5.373 12 12v24c0 6.627-5.373 12-12 12H364c-6.627 0-12-5.373-12-12zm0 72v-24c0-6.627 5.373-12 12-12h104c6.627 0 12 5.373 12 12v24c0 6.627-5.373 12-12 12H364c-6.627 0-12-5.373-12-12z"/></symbol><symbol viewBox="-180 -180 936 872" id="audio" xmlns="http://www.w3.org/2000/svg"><path d="M256 88.017v335.964c0 21.438-25.943 31.998-40.971 16.971L126.059 352H24c-13.255 0-24-10.745-24-24V184c0-13.255 10.745-24 24-24h102.059l88.971-88.954c15.01-15.01 40.97-4.49 40.97 16.971zm182.056-77.876C422.982.92 403.283 5.668 394.061 20.745c-9.221 15.077-4.473 34.774 10.604 43.995C468.967 104.063 512 174.983 512 256c0 73.431-36.077 142.292-96.507 184.206-14.522 10.072-18.129 30.01-8.057 44.532 10.076 14.528 30.016 18.126 44.531 8.057C529.633 438.927 576 350.406 576 256c0-103.244-54.579-194.877-137.944-245.859zM480 256c0-68.547-36.15-129.777-91.957-163.901-15.076-9.22-34.774-4.471-43.994 10.607-9.22 15.078-4.471 34.774 10.607 43.994C393.067 170.188 416 211.048 416 256c0 41.964-20.62 81.319-55.158 105.276-14.521 10.073-18.128 30.01-8.056 44.532 6.216 8.96 16.185 13.765 26.322 13.765a31.862 31.862 0 0 0 18.21-5.709C449.091 377.953 480 318.938 480 256zm-96 0c0-33.717-17.186-64.35-45.972-81.944-15.079-9.214-34.775-4.463-43.992 10.616s-4.464 34.775 10.615 43.992C314.263 234.538 320 244.757 320 256a32.056 32.056 0 0 1-13.802 26.332c-14.524 10.069-18.136 30.006-8.067 44.53 10.07 14.525 30.008 18.136 44.53 8.067C368.546 316.983 384 287.478 384 256z"/></symbol><symbol viewBox="-160 -160 704 832" id="bookmark" xmlns="http://www.w3.org/2000/svg"><path d="M0 512V48C0 21.49 21.49 0 48 0h288c26.51 0 48 21.49 48 48v464L192 400 0 512z"/></symbol><symbol viewBox="-160 -160 640 832" id="checkin" xmlns="http://www.w3.org/2000/svg"><path d="M192 300.813v172.82l-22.015 33.023c-4.75 7.125-15.219 7.125-19.969 0L128 473.633v-172.82a162.221 162.221 0 0 0 64 0zM160 0c79.529 0 144 64.471 144 144s-64.471 144-144 144S16 223.529 16 144 80.471 0 160 0M80 136c0-39.701 32.299-72 72-72a8 8 0 0 0 0-16c-48.523 0-88 39.477-88 88a8 8 0 0 0 16 0z"/></symbol><symbol viewBox="-200 -200 1040 912" id="drink" xmlns="http://www.w3.org/2000/svg"><path d="M192 384h192c53 0 96-43 96-96h32c70.6 0 128-57.4 128-128S582.6 32 512 32H120c-13.3 0-24 10.7-24 24v232c0 53 43 96 96 96zM512 96c35.3 0 64 28.7 64 64s-28.7 64-64 64h-32V96h32zm47.7 384H48.3c-47.6 0-61-64-36-64h583.3c25 0 11.8 64-35.9 64z"/></symbol><symbol viewBox="-160 -160 736 832" id="eat" xmlns="http://www.w3.org/2000/svg"><path d="M207.9 15.2c.8 4.7 16.1 94.5 16.1 128.8 0 52.3-27.8 89.6-68.9 104.6L168 486.7c.7 13.7-10.2 25.3-24 25.3H80c-13.7 0-24.7-11.5-24-25.3l12.9-238.1C27.7 233.6 0 196.2 0 144 0 109.6 15.3 19.9 16.1 15.2 19.3-5.1 61.4-5.4 64 16.3v141.2c1.3 3.4 15.1 3.2 16 0 1.4-25.3 7.9-139.2 8-141.8 3.3-20.8 44.7-20.8 47.9 0 .2 2.7 6.6 116.5 8 141.8.9 3.2 14.8 3.4 16 0V16.3c2.6-21.6 44.8-21.4 48-1.1zm119.2 285.7l-15 185.1c-1.2 14 9.9 26 23.9 26h56c13.3 0 24-10.7 24-24V24c0-13.2-10.7-24-24-24-82.5 0-221.4 178.5-64.9 300.9z"/></symbol>Ah .. I gave up. It was really not worth the time (hours) and effort, especially after a plugin update wiped out my changes.
Hi Chris, I’m trying this again. I still don’t understand the SVG files icon bit. The link you included gave a 404.
Font Awesome suggested using the following code to get the beer icon.
<i class="fas fa-beer"></i>However, your post suggested that I needed a beer.svg from Font Awesome, that I needed to add that SVG to a folder, edit the kinds.svg to add some code. What I don’t understand is what XML code goes where and what any of that XML means, etc. I feel like a step is missing somewhere in your post.
Perhaps it would be simpler to use the existing “Drink” post kind but change the icon to the beer symbol. I’m unsure where or how to do this.
I just don’t understand what the following means.
You’ll want to have one icon named kindname.svg in the svgs folder and another named kinds.svg in the plugin’s root folder. The kinds.svg is a special ‘master’ svg of all of the kinds icons bundled together. If it helps in matching the icon set, all of the current kind icons are made with Font Awesome icons which have the appropriate licensing for distribution.
I downloaded and place a Font Awesome icon called ‘beer.svg’ into the svgs folder. However, the kinds.svg file already existed in the plugin’s root folder. The kinds.svg file does not apparently have all of the kinds icons bundled together since beer.svg is not in that file (it’s a binary file). I really don’t understand how this worked for you but not me. There must be a step I am missing.
In deze serie blogposts wil ik je helpen hoe je met een WordPress site gebruik kunt maken van de diverse IndieWeb plugins. Zoals het kunnen inloggen op andere sites met je eigen domeinnaam en nieuwe artikelen plaatsen met andere applicaties.
Aan de hand van dit artikel laat ik je zien hoe je verschillende soorten posts kunt maken in WordPress. Van bookmarks tot notities, gelezen boeken of locatie checkins. Welkom in de wereld van de Post Kinds.
Wat is Post Kind?
De Post Kind plugin is een WordPress plugin die het mogelijk maakt om allerhande nieuwe social media-achtige posts te maken op je eigen site. Zo zie je op mijn site zo nu en dan bookmark-posts voorbij komen of kortere notities.
WordPress komt standaard met een aantal Post Formats, zoals artikel, status, aside, gallery, link, image etcetera. Hier zijn ze mee gestart toen met name Tumblr met een blogplatform kwam waar deze post types goed werden ondersteund.
Veel WordPress theme ontwikkelaars zijn de Post Formats gaan ondersteunen. Dit betekent in de praktijk dat in het thema door middel van opmaak en weergave de post een bepaalde stijl krijgt. Zo krijgt een Status post geen titel en is het een korte update.
Waarom is dat belangrijk?
Er is geen onherroepelijk bewijs voor, maar het lijkt dat de Post Formats steeds minder worden ondersteund en gebruikt in WordPress themes. De Post Kind plugins pakt de handschoen op van de Post Formats en moderniseert de manier waarop de verschillende soorten posts worden weergegeven én biedt een platform om nieuwe post formaten zelf toe te voegen.
Hoe installeer je de Post Kind plugin?
De installatie van de Post Kind plugin is relatief eenvoudig. Als je de Indieweb plugin hebt geïnstalleerd kun je hem vinden via Indieweb > Extensions in je beheer. Of je gaat via de officiële WordPress Plugin repository en zoekt op Post Kind.
Let op, de Post Kinds plugin werkt niet met de nieuwe Gutenberg editor van WordPress.
Wat stel je vervolgens in?
De configuratie vind je onder Indieweb > Post Kinds tab in je beheer. Hier zie je direct een groot aantal mogelijkheden om posts te maken. Je kunt zelf instellen welke soort posts je wilt maken op je site. Een aantal zijn al vooraf geselecteerd voor je. Ik kan je adviseren om niet direct alles aan te zetten, omdat het je administratie-scherm erg vol maakt. Zet die Post Kinds aan die je zeker gaat gebruiken. Als je later besluit om bepaalde Post Kinds niet meer te gebruiken, kun je ze altijd weer uitzetten, of juist andere types toevoegen.
Een andere optie die je kiest is de
Default Kind for new posts. Het ligt er aan hoe je je site wilt gebruiken. Is het een standaardblog? Zet hem dan opArticle. Wil je een linkblog maken? GebruikBookmark.Beschikbare Post Kinds
Na installatie vind je in de configuratie de soorten Post Kinds die je direct kunt gebruiken en een bepaalde vormgeving hebben voor je thema. Dit zijn de volgende Kinds:
Niet-interactieve Kinds
Article – De traditionele blogpost met titel.
Note – Een statusupdate, een tweet-achtige notitie.
Photo – Een post met een afbeelding als focus. Dit kan de featured image zijn van je post of een van de andere toegevoegde afbeeldingen. Dit is afhankelijk van je theme.
Video – Een post met een embedded video als focus.
Audio – Een post met een embedded audiobestand als focus.
Interactie Kinds
Deze lijst met Post Kinds zijn bedoeld om interactie met andere sites mogelijk te maken. Denk aan een reactie op een bepaalde post, een bookmark of een like. Voor een betere weergave en meer mogelijkheden is het aan te raden om de Post Kinds plugin te gebruiken samen met de Webmentions en Semantic Linkbacks plugin. Deze zal ik in een vervolgartikel bespreken. Hiermee is het mogelijk om de eigenaar van het artikel waar je op reageert automatisch een notificatie te sturen en om je eigen site veel meer je eigen hub te maken van je antwoorden en interacties.
Reply – Een antwoord publiceren op een post van iemand anders
Repost – Een volledige repost van iemand anders content
Like – Complimenten aan de originele auteur van een artikel
Favorite – Bepaalde content die speciaal voor je is
Bookmark – Een link of bookmark opslaan.
Quote – Een quote publiceren
RSVP – Via je eigen site laten weten of je bij een bepaald evenement aanwezig bent.
Passieve Kinds
De passieve Kinds zijn vooral om duidelijk te maken dat je iets hebt gedaan. Je kunt het vergelijken met het “scrobblen” op Last FM, dat automatisch voor je bijhoudt waar je naar luistert. In de plugin kunnen dit zijn:
Listen – Luisteren naar en audio post
Jam – Luisteren naar een muziekstuk wat speciaal voor je is.
Watch – Een video bekijken
Play – Een spel spelen
Read – Iets lezen.
Eat – Wat ben je aan het eten
Drink – Wat drink je
Checkin – Laten weten dat je op een specifieke locatie bent.
Je merkt in bovenstaande lijsten al dat de keuze voor de Post Kinds en de uitleg van de plugin ontwikkelaar best arbitrair is. Wanneer is iets een Like en wanneer een Favorite? Maakt het iets uit voor je? Kies hier vooral wat je zelf wilt en laat je niet teveel leiden door de omschrijvingen.
Hoe gebruik je de plugin?
Ik begin met een simpel voorbeeld, het posten van een bookmark. Ik wil op mijn testsite meer bookmarks plaatsen rondom het Indieweb en ik begin met een bookmark van het artikel Een eigen huis op het IndieWeb op deze site. Ik klik in het WordPress beheer op Posts > Add New en in het vervolgscherm kies ik in de metabox voor
Bookmark. Let op, voor je begint, klik nog opScreen Optionsen zet de het veldResponse Propertiesaan. Deze zou standaard aan moeten staan, maar je weet maar nooit.Je ziet bij je standaard editor een extra box waar je een URL kunt invoeren. Ik zet hier de URL van de bookmark. Op de achtergrond gaat de plugin informatie ophalen van de URL en laat deze zien als je op Details klikt. Het is afhankelijk van de site die je wilt bookmarken welke informatie je krijgt. Mis je iets, zoals een auteur of een ondertitel, dan kun je dit handmatig toevoegen.
Als je de contextuele informatie van je bookmark hebt toegevoegd, kun je nog eigen tekst toevoegen alsof het een normale blogpost betreft. Geef eventueel extra metadata zoals categorie, tags en datum en klik op publiceren.
Zoals je ziet voegt Post Kinds standaard extra informatie toe aan je blogpost. De contextuele informatie die we in het beheer hebben geplaatst, wordt boven je eigen post geplaatst. In de configuratie van de plugin kun je deze ook onder je eigen post plaatsen, het is maar net wat je voorkeur heeft.
Probeer de verschillende Post Kinds eens, voeg likes en favorites toe of een reply op een blogpost. Hou er wel rekening mee dat jouw antwoord op een blogpost nog niet automatisch zichtbaar is bij de originele site. Hier is de Webmention plugin voor nodig, die we in een volgend artikel in detail bespreken.
Post Kind en Micropub
Veel diensten als Pocket en Instapaper hebben eenvoudige one-click manieren om snel een bookmark toe te voegen aan hun dienst. Dat is logisch, je wilt zo min mogelijk frictie om iets te publiceren en mogelijk te delen. Bovenstaande stappen om een bookmark of een like via de WordPress admin te publiceren zijn er te veel. Als je steeds naar de editor moet, dat gaat te snel vervelen en doe je dat niet meer. Dus is het zaak om het jezelf zo makkelijk mogelijk te maken.
Gelukkig is daar de Micropub plugin die we al eerder hebben geïnstalleerd. In combinatie met de Post Kind plugin kun je behoorlijk snel posts maken én ze in de juiste vorm tonen op je site. Zoals je nog weet is de Quill app een handige dienst om iets te posten op je site via Micropub. De bookmark-functie heeft een zogenaamde bookmarklet. Een klein stukje code die je als knop in je browser-balk kunt plaatsen. Hetzelfde geldt voor de Favorite-functie. Samen met de Post Kinds plugin worden bookmarks en favorites direct in de juiste vorm weergegeven, een mooie combinatie dus! Als je liever direct in de WordPress omgeving schrijft met een bookmarklet, dan kan ik je deze uitleg van Chris Aldrich aanbevelen. Tevens als je op zoek bent naar mobiele oplossingen.
Hoe nu verder?
Met deze post heb ik vooral de basics van de Post Kind plugin willen uitleggen. Er is veel mogelijk met deze plugin, zelfs je eigen Post Kind type maken. Je kunt de vormgeving van de individuele Post Kinds aanpassen door middel van eigen templates, maar dat vereist wel wat programmeerwerk.
De Post Kinds plugin hangt heel nauw samen met de Micropub plugin en de Webmentions plugin, vooral om echt goed gebruik te maken van de interactieve kinds die ik hier boven beschrijf. Ik kan je dan ook aanraden om naast Post Kinds de Webmention plugin te installeren en verder te gaan met je Indieweb avontuur!
Credits
Veel dank aan Chris Aldrich en zijn Engelstalige uitleg van deze plugin en de vele updates en aanvullingen op zijn blog!
Syndicated copies:
I created a video overview/walkthrough of how I take highlights and annotations on Hypothes.isHypothes.is and feed them through to my WordPress Website using RSS and IFTTT.com.
I suspect that a reasonable WordPress user could probably set up a free Hypothes.is account and use the RSS feed from it (something like
https://hypothes.is/stream.atom?user=username) to create an IFTTT.com recipe to post it as a public/draft to their WordPress website.My version presented here has also been augmented by also using the Post Kinds Plugin to which I’ve manually added a custom annotation post type along with some CSS for the yellow highlight effect. These additional coding flourishes aren’t absolutely necessary for those who just want to own the data on their website.
If you want to get even fancier you could also do RSS to IFTTT to do a webhook post to an Micropub endpoint or custom code your own solution using their API. Lots of options are available, the most difficult part may be knowing that something like this could even be done.
Syndicated copies: