I had set up two Wordpress development sites, URL's were something like mysite.com/dev/blog1 and mysite.com/dev/blog2. blog2 would fetch posts from categories on blog1 using fetch_feed() e.g. fetch_feed(mysite.com/dev/blog1/category/fun/feed) and everything worked fine.
However, since moving the sites over to mysite.com/blog1 and mysite.com/blog2, the feed does not work. I get the following error:
A feed could not be found at mysite.com/blog1/category/fun/feed. A feed with an invalid mime type may fall victim to this error, or SimplePie was unable to auto-discover it.. Use force_feed() if you are certain this URL is a real feed." } } ["error_data"]=> array(0) { } }
When I go to the feed URL though, the feed does exist.
Any ideas?
The fetch_feed() function is still trying to look at the dev. Highlighted below:
"A feed could not be found at mysite.com/dev/blog1/category/fun/feed. A feed with an invalid mime type may fall vic....."
You will need to remove the dev part from the url.
Had the same problem. I've tried different Wordpress RSS plugins and got the same result: "RSS Error: A feed could not be found at ..."
(For almost all RSS feeds except for feeds from feedburner!)
I contacted our provider / web hosting service, they "unlocked" the domain of the rss feed within a minute and now it works perfectly!
If you're using a webhoster, maybe you need to contact their support for help.
Related
I have a function that loops through my products and creates some json files. Recently this function stopped working correctly.
I tracked it down to the fact the call to the WP API is ignoring the per_page parameter and always grabbing just the first 10.
$response = wp_remote_get($api_url . '/wp-json/wp/v2/products?per_page=50');
I have tried multiple parameters, like adding an offset, nothing works. It grabs the first 10 and that is it.
Has something changed? I tried Googling and I don't find anything relevant. The API documentation says this should work.
If I just put that url with the request in the browser address bar I get the 50.
Is it possible to get RSS feed for BlogSpot for specific keywords?
I have tried with the below URLs but they do not seem to be working.
Atom 1.0: https://blogname.blogspot.com/feeds/posts/default/-/[label]
RSS 2.0: https://blogname.blogspot.com/feeds/posts/default/-/[label]?alt=rss
For keyword-specific feeds, use the following endpoint
https://www.yourblogname.blogspot.com/feeds/posts/default?q=KEYWORD
https://www.blogger.com/feeds/BLOGID/posts/default?q=KEYWORD
The keyword will need to be passed as a query string to the q query parameter.
Be sure to enable blog feed
Go to Settings > Others > Site Feed > Allow Blog Feed then select Full
Blogger labels are case sensitive, It will treat Food differently from food
An example: https://fordemos.blogspot.com/feeds/posts/default/-/Food?alt=rss
I am working with the WORDPRESS REST API and Wordpress version 4.8 for an internal network page at a local office. We have permalinks disabled (security reasons) and thus I am accessing the posts object like so:
https://url/blogs/usernamehere/?rest_route=/wp/v2/posts/12345
I am able to do a GET request and can get the posts data into my view template with no issues. However, I can't seem to figure out how to consume additional content in the post object . I have followed the documentation and tried to do:
https://url/blogs/usernamehere/?rest_route=/wp/v2/posts/12345?_embed=true
But, I get a STATUS 404 .
How would I correctly apply the embed function in the URL so I can get the additional data associated with the post?
Pass the _embed global parameter without a value, per the documentation.
you should do this:
https://url/blogs/usernamehere/?_embed=true&rest_route=/wp/v2/posts/12345
Basically you add _embed=true at before other parameters and after & add other parameters.
I have created an app which is displaying some products using the WooCommerce Rest API.
I have applied a few filters and everything was looking good until I tried to apply a filter for the category
http://foo/wc-api/v3/products?filter[limit]=15&filter[category]=some-category&oauth_consumer_key=ck_xx&oauth_nonce=xx&oauth_signature_method=HMAC-SHA1&oauth_timestamp=xx&oauth_version=1.0&filter%5Blimit%5D=15&filter%5Bcategory%5D=antioxidants&oauth_signature=xx%3D
Now I get the message
DENIED - The requested resource requires user authentication. (XHR): GET ...
Any ideas why that is?
Found the answer (at least it's working for me)
You need to make the filter[category] the first parameter in your query string.
I'll let the guys know about this too.
I am trying to rewrite a url in wordpress so that I can serve up dynamic content based on variables that are passed. I have a plug in that needs variable data passed into it. Currently I have:
http://xyzsite.com/page/?var1=something
this works fine and passes in a $_GET var. So my next step is to clean up the variable so that it looks like
http://xyzsite.com/page/something
I have done a few google searches and come accross some site that looked promising but I cannot get any of them to work. From what I have read, i need to use
add_rewrite_tag and add_rewrite_rule
After reading through the articles I have added this to my functions.php page:
add_rewrite_tag('%var1%','([^&]+)');
add_rewrite_rule('^page/([^&]+)/?','index.php?p=1141&var1=$matches[1]','top');
when i navigate to the page http://xyzsite.com/page/something i get a 404 error. When i navigate the to http://xyzsite.com/page/?var1=something it is still working fine. So it looks as if my rewrite is not registering or working correctly.
Can someone help me to achieve the above rewrite. FYI my permalink settings is set to post name if that matters at all. Thank you.
I̶'̶m̶ ̶n̶o̶t̶ ̶a̶ ̶r̶e̶g̶e̶x̶ ̶p̶r̶o̶,̶ ̶b̶u̶t̶ ̶I̶ ̶s̶u̶s̶p̶e̶c̶t̶ ̶a̶n̶ ̶i̶s̶s̶u̶e̶ ̶i̶n̶ ̶y̶o̶u̶r̶ ̶r̶e̶w̶r̶i̶t̶e̶ ̶r̶u̶l̶e̶:̶
a̶d̶d̶_̶r̶e̶w̶r̶i̶t̶e̶_̶r̶u̶l̶e̶(̶'̶^̶p̶a̶g̶e̶/̶(̶[̶^̶&̶]̶+̶)̶/̶?̶'̶,̶'̶i̶n̶d̶e̶x̶.̶p̶h̶p̶?̶p̶=̶1̶1̶4̶1̶&̶v̶a̶r̶1̶=̶$̶m̶a̶t̶c̶h̶e̶s̶[̶1̶]̶'̶,̶'̶t̶o̶p̶'̶)̶;̶
̶
̶N̶o̶t̶e̶ ̶t̶h̶e̶ ̶/̶?̶ ̶y̶o̶u̶'̶v̶e̶ ̶a̶d̶d̶e̶d̶ ̶a̶t̶ ̶t̶h̶e̶ ̶e̶n̶d̶.̶ ̶T̶h̶u̶s̶ ̶y̶o̶u̶ ̶s̶h̶o̶u̶l̶d̶ ̶a̶c̶c̶e̶s̶s̶ ̶y̶o̶u̶r̶ ̶p̶a̶g̶e̶ ̶w̶i̶t̶h̶ ̶h̶t̶t̶p̶:̶/̶/̶x̶y̶z̶s̶i̶t̶e̶.̶c̶o̶m̶/̶p̶a̶g̶e̶/̶s̶o̶m̶e̶t̶h̶i̶n̶g̶/̶?̶ ̶a̶n̶d̶ ̶n̶o̶t̶ ̶x̶y̶z̶s̶i̶t̶e̶.̶c̶o̶m̶/̶p̶a̶g̶e̶/̶s̶o̶m̶e̶t̶h̶i̶n̶g̶.̶ ̶H̶a̶v̶e̶ ̶y̶o̶u̶ ̶t̶r̶i̶e̶d̶ ̶i̶f̶ ̶t̶h̶a̶t̶ ̶w̶o̶r̶k̶s̶?̶
The stroked out text above is wrong, as Gustavo Straube pointed out in the comments. Please disregard that proposed solution.
My only last advice is to try adding a flush_rules(); after your last add_rewrite_rule, as stated in http://codex.wordpress.org/Rewrite_API/flush_rules.
Note that you should be accessing your query vars with get_query_var('var_name') instead of trying to access $_GET directly.