Forum

Thread tagged as: Problem, Error, Blog

perch_blog_custom 'match' 'in'

Hello, I am trying to list a bunch of blog posts with specific slugs. I think I need to match with 'in' however it doesn't seem to be working. Any idea why?

$slugs='post-1,post-2,post3';

perch_blog_custom(array(
           'filter' => 'postSlug',
           'match' => 'in',
           'value' => $slugs,
           'template' => 'related_posts.html'
));

I am getting a PHP error whenever I try to match the filter with 'in'. If I try to match with 'eq' it works but obviously does not give me the desired result. the PHP error I get is:

Notice: Undefined variable: item in C:\wamp\www\staging\client_name\perch\addons\apps\perch_blog\PerchBlog_Posts.class.php on line 295 Call Stack

Time Memory Function Location

1 0.0046 262192 {main}( ) ..\post.php:0 2 0.0944 5101704 perch_blog_custom( ) ..\post.php:32 3 0.0944 5104440 PerchBlog_Posts->get_custom( ) ..\runtime.php:420

Anthony Di Placido

Anthony Di Placido 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

That's a bug - I'll take a look at it for the next update.