Displaying posts from a custom category

The documentation for WP_Query is the place to look for this 🙂

In particular, you’re after the taxonomy query parameters. Adding a tax_query to your code will look like this:

$rate_query = new WP_Query( array ( 
    'post_type' => 'movies', 
    'posts_per_page'=>'5',
    'tax_query' => array(
       array(
         'taxonomy' => 'movie_genre',
         'field' => 'slug',
         'terms' => array( 'movie-genre-2' ),
       ),
    ),
) ); 

Then just adjust the slugs of both your taxonomy and terms to match how they are defined. You can also include multiple terms.

In addition, there’s a lot more fine-grained control you can add to the query if you like, which is covered in the aforementioned docs.

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