The problem is most likely with the address you are trying to fetch, and it is extremely unlikely it relates directly to your code.
You should check what url is being passed to file_get_contents to make sure it is the one you actually tried in the browser. If they are the same, it might relate to to other server doing different things based on user agent.
Side note: you are reinventing the wheel twice, Why don’t you use the WordPress RSS API or at least the HTTP API?
Update per comment:
if all you need is to parse a standard RSS feed, then you should consider using the fetch_feed function. This function fetches the feed, parses it and caches the result for 12 hours by default.
Related Posts:
- How to Add Image to WordPress RSS-Feed with no Plug-in?
- Enqueue Javascript Correctly for 3.5
- WordPress if (is_page) translation on certain page
- Editing Category RSS Feeds
- remove wp floating submenu in wp dashboard
- Remove a div from RSS feed
- How to change menu labels
- WordPress admin-ajax.php
- How do I modify the custom footer text and get theme version number to show in wordpress admin?
- How to modify the default feed via a function
- Can I add the post featured image to a specific RSS feed?
- How to access all meta data for RSS feed?
- WordPress create custom XML RSS feed template
- Access to “My Site” is missing from the admin bar
- A custom RSS feed link, how do I modify the XML structure?
- Styling admin page rows in order of importance (checkboxes)
- admin-ajax.php loading many times
- How do I change the Go To Categories link in the term_updated_messages
- How to call a function only once (global variable scope)
- Multiple is_page() in page.php
- Set media upload attachment link to none and hide it in WP v3.5
- Fatal error: Call to undefined function plugin_dir_path()
- Switching wp_get_sites to get_sites
- Is it possible to get a theme customizer setting from wp.customize using jquery?
- One button to change all settings in theme customizer?
- Add custom image sizes to media uploader
- Remove tag on my RSS Feed
- Twitter feed is showing blank in WP site [closed]
- How can update custom meta for all posts
- How to add default images into theme customizer image control?
- Is $hook a global variable in WordPress
- Custom Logo URL | Help me print the URL of the custom logo I inserted into my theme
- wrong php date()?
- Include a php file from functions.php only to homepage
- How do I fetch all comments per post via WP REST API?
- Shortcode content output but not in correct place
- How to restrict page access to logged-in users?
- Handling Body class based on Template
- Adding Default Settings to Theme My Login plugin
- Automatically adding new post categories to menu
- Get post id in a function when edit/add a post
- function to assign user role based on a field from usermeta
- get author_name from queried post
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- Pass php dynamic variable to shortcode
- get post content of particular post by url
- Query Pages and post excerpts dynamically
- Get my site session in wordpress?
- Register a menu – Error Header
- Filtering a function’ output for a new continued function
- Shortcode to find and replace URL
- Deleting Certain terms from appearing on the front end as links
- first instantiated SimplePie object cosumes 5mb?
- Theme not calling Jquery properly
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- Usage of call back function of add_meta_box()
- WordPress redirect redirecting too many times or not at all
- Set site title & tagline with wp.config or function.php
- Shortcode to embed Edit Account form not working
- How to make jquery count down timer function manually editable
- Hierarchical taxonomy list with modificated term links
- Add value to new attribute inside WordPress menu items
- Please show me how to use an if/else statement in combination with wp_enqueue
- If Array Values Match Another Array’s Values, Then
- Get user custom field value on function.php
- entire JS folder not loading in a WP theme
- Open and closed function [closed]
- Else/If Statement to Display Photo Descriptions
- Count foreach and display in menu php
- Dynamically Generate Functions and Hooks
- How to debug failed changes to posts?
- Strip from or something better?
- Display additional page templates and a sidebar on plugin activation
- Taxonomy term description with style, only if the description exists?
- Use of antispambot with $curauth->email
- Restrict post to current user in postmeta
- Fatal error login WordPress [duplicate]
- copy fields value to another field
- posts_per_page displays only 2 posts instead of 4 posts
- Get parent category name when only child category is applied to a product
- Adding product permalink on admin order page throwing error
- Before & After Content – After Content directly below Before Content when using require_once
- Taxonomy Child Term, Counter is staying on 0
- How to disable sub menu items from being created?
- How to redirect (301) trashed post to it’s parent taxonomy TERM ARCHIVE instead of 404 page
- How to call WordPress PHP file using external js file
- Using get_theme_mod with checkbox to display content
- admin uploads pre_get_posts not working as expected
- use system script advertising in wordpress multisite
- Insert wordpress tags below posts via functions.php
- Help with my first Metabox helper class
- Pagenav Not appearing on custom Template
- ISOTOPE – Missing/Invalid Arguement Get Terms
- My title is showing after the shortcode
- Load a Header in wordpress
- Trouble figuring out how to get my button to submit comment
- Adding multiple conditional tags in a function?
- How to limit the number of posts in the wordpress loop in conjunction with the “download more” button?
- Need help with conditional logic for menus
- Custom Admin Menu Report for Specific User ID