wp_remote_get
returns a json string.
You have different function to work with this json response. wp_remote_head() wp_remote_retrieve_body(), wp_remote_retrieve_header(), wp_remote_retrieve_headers(), wp_remote_retrieve_response_code(), wp_remote_retrieve_response_message()
The example from the codex:
$response = wp_remote_get( 'http://www.example.com/index.html' );
if( is_array($response) ) {
$header = $response['headers']; // array of http header lines
$body = $response['body']; // use the content
}
Depending on the page request, the body could be an array or object or HTML. Of course, in case of array or object, there’s a need to loop through the results like usually.
Hope it helps
Related Posts:
- Frontend form with multiple posts
- How to go to tag archives using a form
- How to Get All Posts with any post status?
- query_post by title?
- Why query_posts() isn’t marked as deprecated?
- Order by meta value or date?
- Display posts of the last 7 days
- query_posts exclude a meta key
- How do I create a random post that will last for a day
- Modify main WordPress loop with a parse_query filter
- Problem with ‘post__not_in’
- Having trouble generating pagination links on custom query
- query_posts and pagination, still stuck after much research
- Query posts by taxonomy term name
- Sorting problem with ‘query_posts’ funcion in wordpress. Sort by custom field not working
- How to sort by meta value?
- pagination in author.php template returns 404 error
- query recent posts from several categories
- Show Posts From Same Category OR Same Tag
- Post count per (day/month/year) since blog began
- Example Query Posts Showing the Latest Post with the Featured Image
- How to order results by date and meta key?
- Different number of posts on the front page
- Query posts without a specific ID
- posts_per_page => 1 shows 2 posts
- Show individual author rank from query of cumulative post view count for all authors
- Custom posts per page does not work with pagination
- Static Front-Page Excerpts
- creating form for wp_remote_post
- posts_per_page override by default settings
- How to paginate posts correctly that belong to a particular category and are random ordered
- WordPress query_posts and orderby page order
- IF.. post meta show… Conditional Tag Help…?
- How do I correctly get all posts within the last year using the query_posts function?
- How can i display the posts per week in a particular month?
- How to filter query to display posts from parent category only?
- Display random post on a page with post permalink in URL
- Query_post($args)
- WordPress pagination with get_posts?
- Get post and all posts after it by ID?
- query_posts() on key’s value, or key’s existence
- How to display certain category in the loop from WordPress default post type?
- How do I make query use exact post title
- WordPress tax_query not showing private posts
- WordPress /page/2 not working
- My post repeats itself on the second page [closed]
- get_the_title outputs title until spacing; it does not get full length of title
- Filter Loop by Custom Field Value
- meta_query check for meta value in key which holds an array of values
- Display custom post type by custom taxonomy
- WordPress wp_get_attachment_thumb_url full
- Display trimmed version of the_post()
- Exclude posts by post meta value
- How to show the number of each post has been read in a while loop?
- Single-page wordpress theme navigation
- Modify loop but keep the original query, what am I doing wrong?
- meta tag placement for google verification
- Post per page not working if no category specified
- How to change default post type / post to media or attachments
- How to code auto-retry for API call
- How exclude 3 latest posts of a category in query_posts
- Query Products & Store IDs in array
- query_posts orderby multiple ways
- Can I use WP_Query one time and then filter the results multiple times
- Pagination linking to first page
- Posts being viewed
- Meta query stopped working
- Weird problem on if statement
- Issue with sidebar widgets not showing when I do custom queries
- Why would post_type be ignored in this query?
- query_posts call sets is_home() to true
- show all in query_posts on category.php?
- Query Posts Incorrectly Displaying Tags Archives
- Best Query for blog posts
- Most Effective Method? Exclude Category and Number of Posts Per Page
- Script that gets the first tag of post and query all other posts with the same tag
- Trouble highlighting correct menu parent with wp_nav_menu classes while viewing “single posts”
- Custom query looking at multiple custom fields and properly sorting
- Latest 5 post excerpts from 5 different authors in Sidebar
- post var problem with shortcode loop
- Pre-existing arguments when using queries
- Help with query_posts function
- Get posts for each user
- Pull new posts using feed
- query_posts() with multiple meta data comparisons
- Sort Posts By Custom Field Date
- query_posts not working after wordpress 3.7 update
- get_next_posts_link() stops displaying at page 4
- Multiple post queries -category,posts per page,orderby
- Is that the query_posts() the real criminal here?
- How to can I search range of products using between
- Query specific posts from parent by slug rather ID
- How to limit the number of posts on the home page?
- query_posts and sub pages?
- How to refine WP-Query with further criteria
- Query Posts (post meta)
- get all posts with certain meta data
- prevent display duplicate titles on main page
- Lots of SQL queries
- How do I find the first item in the post array?