Can someone please help me edit an array so that instead of displaying posts from one category ID (8), the array displays posts from either category ID 8 OR category ID 649?
An example is on this page, under “Agents Listings”:
The page is currently displaying any of the Agent’s Listings (posts) with category ID = 8. Here is the code that works for the single category:
<?php $agent_name = get_the_title(); ?>
‘cat’ => 8,
‘showposts’ => 4,
‘meta_query’ => array(
‘key’ => ‘agent’,
‘value’ => $agent_name,
‘compare’ => ‘LIKE’,
All I need to do is also show any of the Agent’s posts from category ID = 649, so that if the Agent has two posts with category ID 8 and two posts with category ID 649, the page would show all fours posts.
It doesn’t matter if it first shows posts from category ID 8 and only then from category ID 649, I just need posts with category ID 649 to show if there are less than 4 posts with category 8.
I hope this makes sense and I really appreciate the help.
The page I need help with: [log in to see the link]
- The topic ‘Help with PHP array’ is closed to new replies.