array($post_id), 'post_type' => 'post', 'posts_per_page' => 3, 'post_status' => 'publish', 'ignore_sticky_posts' => true ); if( 0 == $supermag_customizer_all_values['supermag-show-related'] ){ return; } $supermag_related_post_display_from = $supermag_customizer_all_values['supermag-related-post-display-from']; if( 'tag' == $supermag_related_post_display_from ){ $tags = get_post_meta( $post_id, 'related-posts', true ); if ( !$tags ) { $tags = wp_get_post_tags( $post_id, array('fields'=>'ids' ) ); $supermag_cat_post_args['tag__in'] = $tags; } else { $supermag_cat_post_args['tag_slug__in'] = explode(',', $tags); } } else{ $cats = get_post_meta( $post_id, 'related-posts', true ); if ( !$cats ) { $cats = wp_get_post_categories( $post_id, array('fields'=>'ids' ) ); $supermag_cat_post_args['category__in'] = $cats; } else { $supermag_cat_post_args['cat'] = $cats; } } $supermag_featured_query = new WP_Query($supermag_cat_post_args); if( $supermag_featured_query->have_posts() ){ $supermag_related_title = $supermag_customizer_all_values['supermag-related-title']; if( !empty( $supermag_related_title ) ){ ?>