[英]I want to select two category from redux framework but it calls one
My code is below: 我的代码如下:
Sample-config.php 采样的config.php
array(
'id' => 'opt-select-featured-post-3',
'type' => 'select',
'data' => 'categories',
'title' => __(
'Select Category 3rd Columns',
'redux-framework-demo'
),
),
Template-home.php 模板home.php
<?php $my_query = new WP_Query('category_name='.get_cat_name($arefin030201['opt-select-featured-post-3']).'&showposts=1&order=DESC&orderby=id'); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<h3><?php the_title() ?></h3>
<?php the_content() ?><br><a href="<?php the_permalink(); ?>">more info</a>
<?php endwhile; ?>
So if you want to select multiple categories, set multi=>true to your select option. 因此,如果您要选择多个类别,请为您的选择选项设置multi => true。 Then you will be provided with the category IDs and you can query accordingly. 然后,将为您提供类别ID,您可以进行相应的查询。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.