indieweb-post-kinds icon indicating copy to clipboard operation
indieweb-post-kinds copied to clipboard

Remove titles from post kinds in RSS feed

Open ScootRay opened this issue 2 years ago • 1 comments

I've been giving the Post Kinds plugin a nice workout -- loving it so far and I very much appreciate how it contributes to the Indieweb.

One glitch is prior to using Post Kinds I was using Post Formats and in the functions.php I had it set to strip the title from specific formats like so:

/// Remove titles from asides/images/links in RSS feed
//
function remove_status_title_rss ($title) {
  $post_format=get_post_format();
  if ($post_format == "image" || $post_format == "link" || $post_format == "aside") {
    $title="";
  }
  return $title;
}

Now that I've switched to Post Kinds (and a new theme that doesn't support Post Formats), I still need titles to be stripped from all Post Kinds except articles. I'm a total newbie at mucking with WP code so I'm obviously doing this wrong as the below didn't work:

/// Remove titles from asides/images/links in RSS feed
//
function remove_status_title_rss ($title) {
  $post_kind=get_post_kind();
  if ($post_kind != "article") {
    $title="";
  }
  return $title;
}

IOWs it should strip title from all Post Kinds except "article" but it doesn't seem to do the trick.

Would anyone be so kind as to help me tweak this and get it working? The reason I need this is I cross post to Mastodon and Micro.blog and they require titles to be stripped for status (kind) style updates.

Thank you! Ray

ScootRay avatar Feb 12 '22 05:02 ScootRay

The code for Post Kinds doesn't show the title if the title is empty.

I see the function you are creating, but did you add it to the 'the_title_rss' filter ?

dshanske avatar Jun 18 '22 06:06 dshanske