Title: translating RSS feed URL
Last modified: August 21, 2016

---

# translating RSS feed URL

 *  Resolved [bufny](https://wordpress.org/support/users/bufny/)
 * (@bufny)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/translating-rss-feed-url/)
 * The theme I used allways displays the url RSS feed of the default language (eg.
   [http://example.com/feed/](http://example.com/feed/)). If I switch the language,
   the url of the RSS feed remains the same – but if I manually type another language
   in the URL, eg. [http://example.com/fr/feed/](http://example.com/fr/feed/) the
   feed apears correctly in french.
 * How can I translate the url of the rss feed?
 * The widget that shows the RSS feed button calls $theme->rss_url() and in the 
   Themater.php I have:
 *     ```
       function rss_url()
           {
               $the_rss_url = $this->display('rss_url') ? $this->get_option('rss_url') : get_bloginfo('rss2_url');
               return $the_rss_url;
           }
       ```
   
 * later edit:
 * I guess I can hardcode something like this in the rss_url() function:
 *     ```
       if (pll_current_language() == "fr")
         return "http://example.com/fr/feed/"
       ```
   
 * but I don’t like this solution.

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

 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/translating-rss-feed-url/#post-4177280)
 * The standard WordPress functions are filtered. So `get_bloginfo('rss2_url')` 
   should work but I don’t know what is behind `$this->get_option('rss_url')`
 * Does it work using the widget Meta? It uses `get_bloginfo('rss2_url')` and it
   works on my test site.
 *  Thread Starter [bufny](https://wordpress.org/support/users/bufny/)
 * (@bufny)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/translating-rss-feed-url/#post-4177301)
 * I have just called directly in my theme rss widget the get_bloginfo(‘rss2_url’)
   function and nothing… the default language feed is displayed for all languages.
 * Also I have modified in the Themater.php:
 *     ```
       function rss_url()
           {
               return get_bloginfo('rss2_url');
           }
       ```
   
 *  and still dont work.
    🙁
 * However the standard meta widget works perfectly.
 * le: I supposed that there is something wrong with my theme’s widget, its constuctor
   and widget function, and how it calls some functions from its base class, it 
   seems that the filter its not applied…
 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/translating-rss-feed-url/#post-4177381)
 * Are you setting the language from content? If yes could you try to set it from
   language code in Polylang settings? It’s possible that the function is called
   before the language is set.
 *  Thread Starter [bufny](https://wordpress.org/support/users/bufny/)
 * (@bufny)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/translating-rss-feed-url/#post-4177455)
 * Yes, the language is set from content. From language code, still don’t work. 
   However, if I echo pll_current_language() in the widget code, just before the
   RSS button, the language is correctly displayed.
 * Don’t bother anymore, thanks for your time. If I’ll find the bug, I will post
   the reason here.
 * later edit: found it. The widget use some initialization array that was set before
   the language was set. At display time, I’ve made now a supplementary check that
   sets one of its component (the url) to get_bloginfo(‘rss2_url’).
 * I’m sorry for wasting your time. Thanks for the support and for a great plugin.

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

The topic ‘translating RSS feed URL’ is closed to new replies.

 * ![](https://ps.w.org/polylang/assets/icon-256x256.png?rev=3433336)
 * [Polylang](https://wordpress.org/plugins/polylang/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/polylang/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/polylang/)
 * [Active Topics](https://wordpress.org/support/plugin/polylang/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/polylang/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/polylang/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [bufny](https://wordpress.org/support/users/bufny/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/translating-rss-feed-url/#post-4177455)
 * Status: resolved