Hi There,
After some deliberation about how to go about doing this, I discovered that the way to do this was using query_posts()
.
This allows you to do things such as:
// ONLY IF USING GET_PAGES() ELSEWHERE - Get the post ID's from the search to use in get_pages/get_posts
if (have_posts() ) : while ( have_posts() ) : the_post();
array_push($searchPosts, $post->ID);
endwhile; else: endif;
// Create the custom query params
$pages = query_posts($query_string . '&posts_per_page=' . $postsPerPage . '&orderby=' . $sortColumn . '&order=' . $sortOrder . '&meta_key=' . $metaKey . '&offset=' . $offset);
//Style to your hearts content
foreach($pages as $page) {}
Allowing you to customize the results and use pagination with it (well, custom pagination)
NOTE: I’m using get_pages for a lot of my results and pagination hence why $pages = XYZ
and not just directly in the query. This method could be used for the default query without the need for get_pages()
but might require a bit of tweaking.
Hope someone else finds this useful
Mallander