Quantcast
Channel: Toolset » All Posts
Viewing all articles
Browse latest Browse all 20145

Reply To: [Assigned] Remove Pagination from WordPress Archive in main LOOP only

$
0
0

Hi Dimitry,

Please try modify the codes as this:

// Remove pagination on leadership index page
function no_nopaging_leadership_index($query) {
	if (is_post_type_archive('leadership') && is_main_query()) {
		$query->set('nopaging', 1);
	}
}
add_action('parse_query', 'no_nopaging_leadership_index');

More help:
The is_main_query() function is a conditional function that can be used to evaluate whether the current query (such as within the loop) is the "main" query (as opposed to a secondary query).
http://codex.wordpress.org/Function_Reference/is_main_query


Viewing all articles
Browse latest Browse all 20145

Trending Articles