Forum

Thread tagged as: Question, Blog

Perch Blog - get posts that are in 2 categories and in both

Hey just wondering if there is a way to use perch_blog_custom to get posts that are in more than one category so, using AND instead of or?

Chris James

Chris James 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You can set category-match in the options to any or all

I'm passing these options:

[category] => Array
    (
        [0] => news,
        [1] => members-feed
    ),

[category-match] => all,
[sort] => postDateTime,
[sort-order] => DESC,
[skip-template] => 1,
[raw] => 1

and yet i'm still getting items returned that are not in both categories, any ideas what could cause something like this?

also is there anywhere in the docs i can read more into category-match

Drew McLellan

Drew McLellan 2638 points
Perch Support

That's all there is to tell you about category-match.

I'll have a look and see if I can reproduce it.

much appreciated! Thank you