Forum

Thread tagged as: Question, Addons, Blog

Blog custom: post with both two categories

Hi, I am running a blog custom and I want to display those posts that have two categories selected.

<?php perch_blog_custom(array(
    'template' => 'premios.html',
    'sort' => 'postDateTime',
    'category' => 'premios',
    'category' => $lang,
)); ?>

How can I do that?

Raul Serrano

Raul Serrano 0 points

  • 7 years ago

You use an array for multiple category's

Drew McLellan

Drew McLellan 2638 points
Perch Support

That's right:

    'category' => array('premios', $lang),

What I mean is that a simple post have both categories a the same time.

An array prints all posts from 'premios' and all posts from $lang.

Any idea?

Drew McLellan

Drew McLellan 2638 points
Perch Support

You mean an AND rather than an OR? That's not possible currently.

Yes thats it... Thanks Drew