Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Post Author included in Title for RSS feeds
Avatar
Duke Leto III
Member
Free Members
sp_UserOfflineSmall Offline
Jul 2, 2012 - 2:00 pm

I'm curious if this is intended design, or if i missed an option or this is an oversight...

Typically in RSS feeds the Author is a separate parameter from the thread title... 

This has been extremely annoying while trying to use RSS with a RSS widget for displaying  a "recent posts" widget in the sidebar. 

 

Is there a way to change the code or something to remove the author from appearing in the title tags? 

 

I've been banging my head against the wall trying to figure out why disabling "Display Author" in the widget options wielded no results lol

 

Thanks!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 2, 2012 - 2:04 pm

the widget is not rss feeds... so of course doing anything in the widget will NOT affect RSS feeds...

but we have filters in place to allow you to do what you want..  think there are several posts on the topic... but can pass along again if you want...

and in the next version, 5.2, that will be an option for the rss feeds directly...

Avatar
Duke Leto III
Member
Free Members
sp_UserOfflineSmall Offline
Jul 2, 2012 - 3:11 pm

What i meant to say was that the widget has the option to display or not certain parameters of the RSS feed input. I tested with other RSS feeds and they appear to separate the author from the Title. In the RSS feeds generated by simple press, the author appears IN the title tags, as <title>[author] on [thread title]</title>

I did try searching these forums for related topics but came up empty handed. I'll search some more now, but in the mean time if you could pass along the topics you mention, that'd be handy. 

Thanks!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 2, 2012 - 3:47 pm

oh you meant an rss widget, not our recent posts widget... got it... and yes, by default our title includes who posted it...

but what I said still applies, until we the option is available in the next version, you will need to use a filter to remove it... something like this...

add_filter('sph_feed_item', 'my_feed_title_filter',10,2);
function my_feed_title_filter($item, $spThisPostList) {
    $item->title = $spThisPostList->topic_name;
    return $item;
}

put that in your sp theme spFunctions.php... and be sure to have created your own theme (http://codex.simple-press.com/.....g-a-theme/) vs editing ours directly or changes will be lost on upgrades...

>

Avatar
Duke Leto III
Member
Free Members
sp_UserOfflineSmall Offline
Jul 2, 2012 - 5:42 pm

That bit of code worked perfectly. Thanks very much, Mr Papa! 

The quick support was most definitely appreciated. 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 2, 2012 - 5:47 pm

No problem. Glad to help. And it will be an option in the next version, but your custom filter will continue to work too... >

Avatar
Rem Kingston
Member
Free Members
sp_UserOfflineSmall Offline
May 14, 2015 - 5:34 am

Apologies for digging up an old thread but search brought me here!

 

Does the option to tweak RSS title output per a forum/group now exist.  If so, where abouts would I find it Mr Papa?

 

Many thanks in advance! 🙂

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 14, 2015 - 7:10 am

i have to say I don't remember this from almost 3 years ago! but having looked I can't actually find anything on it. The filter above should still work thigh.

Mr Papa will be along later so if I have missed something I am sure he will let us both know...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Rem Kingston
Member
Free Members
sp_UserOfflineSmall Offline
May 14, 2015 - 1:23 pm

Does this work per a forum or would that remove all authors from all RSS feeds?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 14, 2015 - 8:59 pm

that would be on all forums...  if you want to be more specific, you will need to check the forum in question... something like:

add_filter('sph_feed_item', 'my_feed_title_filter',10,2);
function my_feed_title_filter($item, $spThisPostList) {
    if ($spThisPostList->forum_id == 2) $item->title = $spThisPostList->topic_name;
    return $item;
}

which will only do the replacement on forum id of 2...   would go in your spFunctions.php file of your sp theme..  as always we recommend a child theme or create your own theme...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626