Bird
0
0

Which parameter in WP_Query is used to retrieve posts from a specific category?

easy📝 Conceptual Q2 of 15
Wordpress - WordPress Query and Database
Which parameter in WP_Query is used to retrieve posts from a specific category?
Apost_type
Bpost_status
Cauthor_name
Dcategory_name
Step-by-Step Solution
Solution:
  1. Step 1: Identify category filtering parameter

    WP_Query uses 'category_name' to filter posts by category slug.
  2. Step 2: Differentiate from other parameters

    'post_type' filters by type, 'author_name' by author, and 'post_status' by status, not category.
  3. Final Answer:

    category_name -> Option D
  4. Quick Check:

    Category filter parameter = category_name [OK]
Quick Trick: Use category_name to filter posts by category slug [OK]
Common Mistakes:
  • Using post_type to filter categories
  • Confusing author_name with category filter
  • Using post_status to filter categories

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Wordpress Quizzes