date( 'F jS, Y', $time ), 'before' => date( 'F jS, Y' ), 'inclusive' => true, ); } $fw_cat_id = ct_default_akg( 'category', $atts, 'all_categories' ); $fw_cat_id = ( empty( $category ) || 'all_categories' === $category ) ? '' : $category; $type = ct_default_akg( 'type', $atts, 'recent' ); $query = new WP_Query( [ 'post_type' => 'post', 'order' => 'DESC', 'posts_per_page' => $items, 'date_query' => $date_query, 'cat' => $fw_cat_id, 'orderby' => ( 'recent' === $type ) ? 'post_date' : 'comment_count', ] ); // Post thumbnail $has_thumbnail = ct_default_akg( 'display_photo', $atts, 'no' ) === 'yes'; $data_thumbnail = ''; if ( $has_thumbnail ) { $data_thumbnail = ' data-thumbnail="true"'; } // Post meta $has_meta = ct_default_akg( 'display_date', $atts, 'no' ) === 'yes'; // Comments $has_comments = ct_default_akg( 'display_comments', $atts, 'no' ) === 'yes'; // Widget title $title = ct_default_akg( 'title', $atts, '' ); if ( empty( $title ) ) { $title = __( 'Posts', 'ct' ); } // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $before_widget; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $before_title . wp_kses_post( $title ) . $after_title; ?> have_posts() ) { ?>