Target specific group of posts
-
On my site there is a google map with markers for all the properties. I need to place that map with markers on one of my pages, which contains an agent and all his/her properties. Both agents and properties are custom posts. Markers are made of properties addresses.
So far I was able to put the map, but it shows the markers for all the properties available. I don’t know how to target only these few properties that are assigned for particular agent.
The code that checks if google map is needed looks like this: https://pastebin.com/hQXDengG
I modified it by adding
|| is_singular( 'agent' )
on line 26.When I tried to target specific agent with “is_single(‘agent_name’); it is doing the same thing, showing all the properties. The question is how to modify this code to target every agent separately. I guess I need some kind of if statement.
- The topic ‘Target specific group of posts’ is closed to new replies.