PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, July 8, 2022

[FIXED] How do I retrieve featured posts using the Wordpress API (v1)?

 July 08, 2022     api, posts, wordpress, wordpress-featured-image     No comments   

Issue

I'm trying to use the Wordpress API (version 1 - not the new Rest API) to retrieve blog posts from various sites. However, I noticed that it was not retrieving the "featured" posts, only normal ones.

The API call I am using is: https://public-api.wordpress.com/rest/v1/sites/$site/posts

Is there a way to retrieve all the posts (normal and featured)?
Thank you!


Solution

User tried and confirmed to be working

https://developer.wordpress.com/docs/api/1/get/sites/%24site/posts/

There's a Query Parameter called 'sticky'.



Answered By - designtocode
Answer Checked By - Senaida (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing