View post with specific category id and name which I selected in the backend (drop-down option)

Try this code. <?php $cat_id = get_theme_mod(‘cat_choose’, $defaults); ?> <p><?php echo get_cat_name( $cat_id ); ?></p> <hr> <?php $args = array( ‘post_type’ => ‘post’ , ‘orderby’ => ‘date’ , ‘order’ => ‘DESC’ , ‘cat’ => $cat_id, ‘posts_per_page’ => -1, ); $cat_posts = new WP_query($args); if ($cat_posts->have_posts()) : while ($cat_posts->have_posts()) : $cat_posts->the_post(); ?> <div> <div> <h1><?php the_title(); … Read more