scienartic
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Query posts inside custom post typeHello!
Thank you very much for all your answers. Unfortunately i was not yet able to solve the issue.@lidya1859: yes, i use the ‘paged’ => $paged in my WP_Query query.
@piyush: Thank you for your code. When i replace the required parts, i see a nice counter from 1 to 5 pages with a “next” link, but when i click on any links, nothing happens. The page just reloads. I guess this is because the links are adding the /page/[pagenumber] to the url which is not working
@keesiemeijer: When i add the page number to the ULR without /page/, then it is leaving the URL with the page number but this does not effect the WP_Query.
Edit: I was able to create a pagination! I’ve modified Piyush code so it looks like this:
echo paginate_links( array( 'base' => $permalink.'/%#%', 'format' => '?page=%#%', 'current' => max( 1, get_query_var('page') ), 'total' => $wp_query2->max_num_pages, 'show_all' => False, 'end_size' => 1, 'mid_size' => 5, 'prev_next' => True, 'prev_text' => __('PREV'), 'next_text' => __('NEXT'), 'type' => 'plain', 'add_args' => FALSE, 'add_fragment' => '' ) );
(The $permalink variable is the permalink of the single product)
And in my WP_Query i use ‘paged’ => get_query_var(‘page’)Thank you very very much for your support!