Use the sample question below as a guide to solve the 5 questions.

Good Luck !!!

Question
: Write out the array for a custom query function ($args) that will show posts only from a category named ‘shop’.

Solution:  $args = array (

‘category_name’ => ‘shop’

);

  1. Write out the array for a custom query function ($args) that will show posts only from a category named ‘News’ and that have a tag called ‘Batman’.
  2. Write out the array for a custom query function ($args) that will show posts only from authors with the following ids ‘1, 14, 15, 28, 33’.

  3. Write out the array for a custom query function ($args) that will show posts from all categories with the exception of a category with an id ‘18’.

  4. Write out the array for a custom query function ($args) that will only show 3 random posts that are password protected.

  5. Write out the array for a custom query function ($args) that will show posts from a post type called ‘actors’ while skipping the first 2 most recent posts.