Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove titles from post kinds in RSS feed #341

Open
ScootRay opened this issue Feb 12, 2022 · 1 comment
Open

Remove titles from post kinds in RSS feed #341

ScootRay opened this issue Feb 12, 2022 · 1 comment

Comments

@ScootRay
Copy link

ScootRay commented Feb 12, 2022

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

@dshanske
Copy link
Owner

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants