Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Do not use both category_name and cat arguments. This will confuse WP :). Multiple categories should be contained in one or the other. You may pass a comma delimited list of values for either arg, but they must all be of the same type. numeric IDs for “cat” or alphabetic for “category_name”.

    If you prefer to pass arrays instead of lists, you could instead use “category__and” or “category__in” args. These accept arrays of ID integers.

    You should always only include one taxonomy arg in a query. If you require complex taxonomy logic, use “tax_query”.

Viewing 1 replies (of 1 total)

The topic ‘Trying to loop posts from a certain category’ is closed to new replies.