Skip to main content
added 132 characters in body
Source Link

I searched around for similar problems but it did not worked for me, im a total beginner with WordPress.

I made a custom query but the pagination throwing me 404 error

Query

$paged = (get_query_var('page')) ? get_query_var('page') : 1;

$default = array(
    'post_type' => 'dlm_download',
    'posts_per_page' => 2,
    'paged' => $paged,
    'meta_key' => '_featured',
    'dlm_download_category' => $term->slug
); 

$args = $default;

foreach ($downloads as $download) :  setup_postdata($download); 
// loop here
endforeach;

Pagination

$the_query = new WP_Query( $args );
                $big = 999999999; 
                $pagenum = str_replace( $big, '%#%',  get_pagenum_link( $big  ) );

                echo '<div class="pagination">';
                    echo paginate_links( array(
                        'base' => $pagenum,
                        'format' => '?paged=%#%',
                        'current' => max( 1, get_query_var('paged') ),
                        'total' => $the_query->max_num_pages
                    ) );
                echo "</div>";

And when i get http://mysite.com/?dlm_download_category=kategoria-1&paged=2

404 Error, could please someone give me a hint on this?

I searched around for similar problems but it did not worked for me, im a total beginner with WordPress.

I made a custom query but the pagination throwing me 404 error

Query

$paged = (get_query_var('page')) ? get_query_var('page') : 1;

$default = array(
    'post_type' => 'dlm_download',
    'posts_per_page' => 2,
    'paged' => $paged,
    'meta_key' => '_featured',
    'dlm_download_category' => $term->slug
);

Pagination

$the_query = new WP_Query( $args );
                $big = 999999999; 
                $pagenum = str_replace( $big, '%#%',  get_pagenum_link( $big  ) );

                echo '<div class="pagination">';
                    echo paginate_links( array(
                        'base' => $pagenum,
                        'format' => '?paged=%#%',
                        'current' => max( 1, get_query_var('paged') ),
                        'total' => $the_query->max_num_pages
                    ) );
                echo "</div>";

And when i get http://mysite.com/?dlm_download_category=kategoria-1&paged=2

404 Error, could please someone give me a hint on this?

I searched around for similar problems but it did not worked for me, im a total beginner with WordPress.

I made a custom query but the pagination throwing me 404 error

Query

$paged = (get_query_var('page')) ? get_query_var('page') : 1;

$default = array(
    'post_type' => 'dlm_download',
    'posts_per_page' => 2,
    'paged' => $paged,
    'meta_key' => '_featured',
    'dlm_download_category' => $term->slug
); 

$args = $default;

foreach ($downloads as $download) :  setup_postdata($download); 
// loop here
endforeach;

Pagination

$the_query = new WP_Query( $args );
                $big = 999999999; 
                $pagenum = str_replace( $big, '%#%',  get_pagenum_link( $big  ) );

                echo '<div class="pagination">';
                    echo paginate_links( array(
                        'base' => $pagenum,
                        'format' => '?paged=%#%',
                        'current' => max( 1, get_query_var('paged') ),
                        'total' => $the_query->max_num_pages
                    ) );
                echo "</div>";

And when i get http://mysite.com/?dlm_download_category=kategoria-1&paged=2

404 Error, could please someone give me a hint on this?

Custom Pagination in custom loop for custom post type pagination throwing 404 error

improved formatting
Source Link
Sisir
  • 7.8k
  • 8
  • 60
  • 99

I searched around for similar problems but it did not worked for me, im a total beginner with wordpressWordPress.

I made a custom query but the pagination throwing me 404 error

my query

Query

$paged = (get_query_var('page')) ? get_query_var('page') : 1;

$default = array(
    'post_type' => 'dlm_download',
    'posts_per_page' => 2,
    'paged' => $paged,
    'meta_key' => '_featured',
    'dlm_download_category' => $term->slug
);

Pagination

Pagination

$the_query = new WP_Query( $args );
                $big = 999999999; 
                $pagenum = str_replace( $big, '%#%',  get_pagenum_link( $big  ) );

                echo '<div class="pagination">';
                    echo paginate_links( array(
                        'base' => $pagenum,
                        'format' => '?paged=%#%',
                        'current' => max( 1, get_query_var('paged') ),
                        'total' => $the_query->max_num_pages
                    ) );
                echo "</div>";

And when i get http://mysite.com/?dlm_download_category=kategoria-1&paged=2http://mysite.com/?dlm_download_category=kategoria-1&paged=2

404 Error, could please someone give me a hint on this?

I searched around for similar problems but it did not worked for me, im a total beginner with wordpress.

I made a custom query but the pagination throwing me 404 error

my query

$paged = (get_query_var('page')) ? get_query_var('page') : 1;

$default = array(
    'post_type' => 'dlm_download',
    'posts_per_page' => 2,
    'paged' => $paged,
    'meta_key' => '_featured',
    'dlm_download_category' => $term->slug
);

Pagination

$the_query = new WP_Query( $args );
                $big = 999999999; 
                $pagenum = str_replace( $big, '%#%',  get_pagenum_link( $big  ) );

                echo '<div class="pagination">';
                    echo paginate_links( array(
                        'base' => $pagenum,
                        'format' => '?paged=%#%',
                        'current' => max( 1, get_query_var('paged') ),
                        'total' => $the_query->max_num_pages
                    ) );
                echo "</div>";

And when i get http://mysite.com/?dlm_download_category=kategoria-1&paged=2

404 Error, could please someone give me a hint on this?

I searched around for similar problems but it did not worked for me, im a total beginner with WordPress.

I made a custom query but the pagination throwing me 404 error

Query

$paged = (get_query_var('page')) ? get_query_var('page') : 1;

$default = array(
    'post_type' => 'dlm_download',
    'posts_per_page' => 2,
    'paged' => $paged,
    'meta_key' => '_featured',
    'dlm_download_category' => $term->slug
);

Pagination

$the_query = new WP_Query( $args );
                $big = 999999999; 
                $pagenum = str_replace( $big, '%#%',  get_pagenum_link( $big  ) );

                echo '<div class="pagination">';
                    echo paginate_links( array(
                        'base' => $pagenum,
                        'format' => '?paged=%#%',
                        'current' => max( 1, get_query_var('paged') ),
                        'total' => $the_query->max_num_pages
                    ) );
                echo "</div>";

And when i get http://mysite.com/?dlm_download_category=kategoria-1&paged=2

404 Error, could please someone give me a hint on this?

Source Link
Loading