What does `get_queried_object()` return on a single post page?

WordPress Expert Easy

WordPress Expert — Easy

What does `get_queried_object()` return on a single post page?

Key points

  • It specifically returns the WP_Post object, not the WP_Query object or user object.
  • This function is helpful for retrieving details about the post being viewed.
  • It is not used to get information about all posts returned by the main query.

Ready to go further?

Related questions