adding excerpt or content in rss title
-
I want to add rss excerpt to post title,any help?
-
my site http://www.marathikavitablog.in
You can modify what title is sent with ‘the_title_rss’ filter.
thanks
need little spoon feeding as what I shoul put and whereEven though this is a simple change, you still should create a child theme or plugin so your change is protected from updates. These, at the most basic level, are nothing more then creating a file with a correctly formatted header comment and placing it in the right place.
The filter hook would be something like this (untested):
add_filter('the_title_rss', 'mar_add_excerpt'); function mar_add_excerpt( $title ) { return $title . get_the_excerpt(); }Placed on your plugin’s page or child theme’s functions.php.
thanks due
but not workinI’m not sure what to tell you. I have now tested the above code and it works as expected on my local test installation. I set it up as a plugin, but a child theme would work as well.
Is your site using the default RSS2 template?
yes
what theme u using ?twentythirteen. Shouldn’t matter unless a theme or plugin is overriding the default RSS2 template. It could be your theme or one of your plugins is interfering with the normal operation of the filter. Try deactivating your plugins and switching to one of the default themes. You should see excerpts added to titles. Switch back to your normal theme and check for proper operation. Then activate your plugins one by one, testing each time, until the filter stops working again. You’ve discovered what is causing the interference. The problem then is what to do about it.
actually code is doing effect but excerpt are not seen
Sorry, I do not understand. If the code is having an effect, then the excerpt would be seen as part of the title. I’m not convinced your feed is using the default template, otherwise your feed would have a
<content:encoded>section. (line 96 of feed-rss2.php). Admittedly, it otherwise appears identical. If your feed template is not callingthe_title_rss()to get the title, then my code will likely not work.How do you know the code has an effect if the excerpt cannot be seen?
when I apply code ,then rss feed got vanish
anyways ,plz check http://www.marathikavitablog.in ,default theme is there
Oh, that kind of effect! You are using contango theme. It does not appear to do anything with feeds, but I could be wrong. Plugins can also affect feeds, so the elimination process described in my post before last is the best way to see which portion is effecting the feed.
Before you start in on that, check your error logs. You may have a simple syntax error that is easily resolved. Make a feed request with the erroneous code in place, noting the exact time. Check the PHP error log for a recent entry made at that time.
can u tell which theme u tried? I will disable all plugins
The topic ‘adding excerpt or content in rss title’ is closed to new replies.