0

I'm using the WP REST API v2 to try and search for all posts with the same title, what I'm trying to do is create a sort of head-to-head/previous meetings page for 2 teams.

At the moment i can retrieve a single post with a slug no problem

.../wp-json/sportspress/v2/events?slug=team1-vs-team2

When i use a search it retrieves all the events with team1 and team2, but also all references to team1 & 2 from post content which is not what I want...

.../wp-json/sportspress/v2/events?search=team1+team2

How do i retrieve a post using the search using the exact post title as shown below in title > rendered ??

0   
  id    60455
  date  "2016-11-22T19:30:00"
  date_gmt  "2016-11-22T19:30:00"
  modified  "2016-11-23T09:25:29"
  modified_gmt  "2016-11-23T07:25:29"
  slug  "team1-vs-team2"
  status    "publish"
  type  "sp_event"
  link  ".../event/team1-vs-team2/"
  title 
      rendered  "Team1 vs Team2"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.