[英]I want to select two category from redux framework but it calls one
我的代碼如下:
采樣的config.php
array(
'id' => 'opt-select-featured-post-3',
'type' => 'select',
'data' => 'categories',
'title' => __(
'Select Category 3rd Columns',
'redux-framework-demo'
),
),
模板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; ?>
因此,如果您要選擇多個類別,請為您的選擇選項設置multi => true。 然后,將為您提供類別ID,您可以進行相應的查詢。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.