loop_end
hook is passing WP_Query
object as argument. You can use is_main_query()
method on that object (don’t confuse with function of same name) and it will only be true for main query and not secondary ones.
loop_end
hook is passing WP_Query
object as argument. You can use is_main_query()
method on that object (don’t confuse with function of same name) and it will only be true for main query and not secondary ones.