Is the query the main query?

Signature

is_main_query()

Return

(boolean)

Source

function is_main_query() {
	if ( 'pre_get_posts' === current_filter() ) {
		$message = sprintf( __( 'In <code>%1$s</code>, use the <code>%2$s</code> method, not the <code>%3$s</code> function. See %4$s.' ),
			'pre_get_posts', 'WP_Query::is_main_query()', 'is_main_query()', __( 'http://codex.wordpress.org/Function_Reference/is_main_query' ) );
		_doing_it_wrong( __FUNCTION__, $message, '3.7' );
	}

	global $wp_query;
	return $wp_query->is_main_query();
}
WP Trac GitHub

Link here