Posts not showing on page

There aren’t any errors in your code. I’m able to copy / paste it into functions.php and return 3 posts categorized under “testimonials” without issue.

By default this WP_Query will retrieve only ‘post’ matches so if you are using pages or a custom post type you’ll need to specify that in your query args as:

$args['post_type'] = 'page';

or

$args['post_type'] = 'custom_post_type_name';

The only other thing to check is to ensure you’ve added posts to the “testimonials” category in the WordPress dashboard.

I hope this helps.

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