My code is below:
Sample-config.php
array(
'id' => 'opt-select-featured-post-3',
'type' => 'select',
'data' => 'categories',
'title' => __(
'Select Category 3rd Columns',
'redux-framework-demo'
),
),
Template-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. Then you will be provided with the category IDs and you can query accordingly.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.