I’m stuck on trying call an category slug option variable using the Redux Framework – that is utilizing multi-category select – inside the query.
Here’s my Redux option:

    'id'       => 'mosaic-slider-categories',
    'type'     => 'select',
    'data'     => 'categories',
    'multi'    => true,
    'title'    => __( 'Filter posts by Category', 'redux-framework-demo' ),
    'subtitle' => __( '', 'redux-framework-demo' ),
    'desc'     => __( 'Selected categories in this field will show up their posts in the mosaic slider.', 'redux-framework-demo' ),

Here’s what I have as my query:

$td_slider_category = zuzu_get_option( 'mosaic-slider-categories' );

    $td_args = array(
        'ignore_sticky_posts' => 1,
        'posts_per_page'      => 3,
        'category_name'       => $td_slider_category,
        'post_status'         => 'publish'

    $slider_posts   = new WP_Query( $td_args );

I also got this warning:

Warning: urlencode() expects parameter 1 to be string, array given in
D:betawww.magazine.devwp-includesformatting.php on line 4768

Read more here: Display posts by categories in query using redux framework variable


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: