Forum

Thread tagged as: Question, Problem, Blog

Filter not working in blog

Hi,

I have created a checkbox in my blog post. This checkbox is called "homefeatured" and is used to display posts on homepage or not.

on my home page i have added: <?php perch_blog_custom(array( 'template'=>'blog/post_listing_small.html', 'count'=>'1', 'filter' => 'homefeatured', 'match' => 'eq', 'value' => '1' )); ?>

but this isnt working - any ideas?

Thanks

Paul Langley

Paul Langley 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You can't do that in the current version of Blog. You can only filter on the fixed table fields. This is something we're working on.

A workaround would be to use a category or tag.

ah ok

sorry i tried tag but perhaps the syntax is incorrect - could you take a look:

perch_blog_custom(array(
 'template'=>'blog/post_listing_small.html',
 'count'=>'1',
'filter' => 'tag',
    'match' => 'contains',
    'value' => 'featured'
));
Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, the syntax is incorrect:

perch_blog_custom(array(
    'template' => 'post_listing_small.html',
    'count' => '1',
    'tag' => 'featured',
));

The options are listed here: https://docs.grabaperch.com/docs/blog/page-functions/custom/