last day (14 days later) » 

5:47 AM
1
Q: Get array of ID's then Query different post type by those ID's

user2593040I am needing some assistance. My goal is to query "clinics" post type by array of zip codes. Then get the ID's of those clinics and run another query of post type called "clinicspromo" to get those results. Then inside the loop, run query #3 to retrieve the clinic information again that is tied t...

 
I got an error - Fatal error: Call to undefined function array_column()
 
Simply try this: $posts = array_column($postlist, 'ID'), cause you use the result as array.
 
Do I replace this inside the foreach loop?
 
Nope, instead of foreach loop.
 
Still getting the same error. I took out the foreach loop and but it above the $current variable. $posts = array_column($postlist, 'ID'); $current = array_search( get_the_ID(), $posts );
 
5:47 AM
make a print_r on $posts.
You can simply try with this: $posts[] = $post->ID;
 
Ok I will try that
 
I make an answer take a look.
Remove all the comments in the post.
 
Ok I will look
Do I still use array_search line?
It works! I replaced array_search line with $current = implode(', ', $posts);
Still testing it but I was able to retrieve the ID's and echo them. Thank you!!!
 
6:04 AM
Remove all the comments in the post.
 
Ok I will do that, Thank you again!
You meant commented lines? Or actual comment/replies below?
 
My "Remove all the comments in the post." means the comments. Not from the post.
actual comment/replies below?
 
They are nor useful.
not
 
What do you charge an hour? I am looking for someone who can write queries in the future.
Possibly more work than just queries
I work for a couple of companies and we have some big projects coming up. It would be nice to hire someone who has more PHP experience than I do.
 
6:17 AM
you can contact with me at: skype: tanvir0906
 
Ok Great! Thanks again! What do you charge per hour?
 
This is not the place for this kind of talk. So please leave is better.
 

last day (14 days later) »