Displaying a specific sub-category’s posts from wp_query

You can do it by manipulating the WP_Query arguments like below-

$idObj = get_category_by_slug('water-pumps-modal'); 
$args1 = array(
    'post_type' => 'post',
    /*'category_name' => 'modal',*/
    'category__in' => array( $idObj->term_id ), // Take only IDs of the categories
    'posts_per_page' => '1',
);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)