'post', 'posts_per_page' => 4, 'cat' => absint( $cat_id ), 'ignore_sticky_posts' => true, ); // Run The Loop. $query = new WP_Query( $args ); if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); $page_post[$i]['id'] = get_the_id(); $page_post[$i]['title'] = get_the_title(); $page_post[$i]['url'] = get_the_permalink(); $page_post[$i]['image'] = has_post_thumbnail() ? get_the_post_thumbnail_url( get_the_id(), 'post-thumbnail' ) : ''; // Push to the main array. array_push( $content[$i], $page_post[$i] ); endwhile; endif; wp_reset_postdata(); $i++; endforeach; if ( ! empty( $content ) ) { $input = $content; } return $input; } endif; // featured section content details. add_filter( 'magazinews_filter_featured_section_details', 'magazinews_get_featured_section_details' ); if ( ! function_exists( 'magazinews_render_featured_section' ) ) : /** * Start featured section * * @return string featured content * @since Magazinews 1.0.0 * */ function magazinews_render_featured_section( $content_details = array() ) { $options = magazinews_get_theme_options(); $cats = ! empty( $options['featured_content_category'] ) ? $options['featured_content_category'] : array(); if ( empty( $content_details ) ) { return; } ?>