Forum

Thread tagged as: Question, Blog

Filter post content based on category?

Hi, is there an easy way to show specific content from a post based on category? This is from an array already filtering by the specific category.

<?php
                    $opts = array(
                        'template'=>'blog/art_list.html',
                        'sort'=>'postDateTime',
                        'sort-order'=>'DESC',
                        'count'=>'100',
                        'category' => array('curator'),
                    );
                    perch_blog_custom($opts);
?>

Can we use a perch IF based on catTitle matches or contains? Each post may be in one or more categories.

Thanks.

Stuart Farrell

Stuart Farrell 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you want to branch within the template based on category? Yes you can do that, within the <perch:categories> tags in your template.

Ah cool, works! Never used that before. Thanks.