Skip to content

Remove titles from post kinds in RSS feed #341

@ScootRay

Description

@ScootRay

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions