Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter marathikavitablog

    (@marathikavitablog)

    Moderator bcworkz

    (@bcworkz)

    You can modify what title is sent with ‘the_title_rss’ filter.

    Thread Starter marathikavitablog

    (@marathikavitablog)

    thanks
    need little spoon feeding as what I shoul put and where

    Moderator bcworkz

    (@bcworkz)

    Even 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.

    Thread Starter marathikavitablog

    (@marathikavitablog)

    thanks due
    but not workin

    chk http://www.marathikavitablog.in/feed

    Moderator bcworkz

    (@bcworkz)

    I’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?

    Thread Starter marathikavitablog

    (@marathikavitablog)

    yes
    what theme u using ?

    Moderator bcworkz

    (@bcworkz)

    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.

    Thread Starter marathikavitablog

    (@marathikavitablog)

    actually code is doing effect but excerpt are not seen

    Moderator bcworkz

    (@bcworkz)

    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 calling the_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?

    Thread Starter marathikavitablog

    (@marathikavitablog)

    when I apply code ,then rss feed got vanish

    anyways ,plz check http://www.marathikavitablog.in ,default theme is there

    Moderator bcworkz

    (@bcworkz)

    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.

    Thread Starter marathikavitablog

    (@marathikavitablog)

    can u tell which theme u tried? I will disable all plugins

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘adding excerpt or content in rss title’ is closed to new replies.