0

I am using WP 4 beta and have a site at blah.com/blog but I display the posts on my site at blah.com/articles

I want all of the URLs in my RSS feed to use my site URL. Following what was mentioned here: Change the link URL in default RSS feeds

I added this filter to the bottom of plugin.php (add_filter doesn't work in functions.php in 4 beta because it's defined in plugin.php which is loaded after functions.php, I found out)

add_filter( 'the_permalink_rss', 'wpse_96602_change_feed_item_url' );

function wpse_96602_change_feed_item_url( $url )
{
return str_replace('/blog/','/article/',$url);
}

But this hasn't worked. What do I need to do? Thanks in advance :)

3
  • Maybe you can do similar as discussed in this answer ?
    – birgire
    Commented Aug 6, 2014 at 0:29
  • 1
    It's not clear why doesn't WP just generate correct links, which probably has something to do with how you changed URL structure?.. Also I don't follow what exactly your issue with priorities. If this is resolved please add your solution as an answer and accept it.
    – Rarst
    Commented Aug 6, 2014 at 11:06
  • It was because my blog is at blah.com/blog but I use the WP API to actually display blog posts on another page on my site. Setting the priority of the filter to PHP_INT_MAX fixed the problem. Commented Aug 22, 2014 at 2:25

1 Answer 1

0

It was because my blog is at blah.com/blog but I use the WP API to actually display blog posts on another page on my site. Setting the priority of the filter to PHP_INT_MAX fixed the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.