Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress Duplication when searching &order=desc

Discussion in 'Misc WordPress Requests' started by lizverd, Oct 20, 2017.

  1. lizverd

    Guest

    Duplication when searching &order=desc, by lizverd

    Hi
    I took the code here
    https://codex.wordpress.org/Function_Reference/paginate_links

    <?php
    global $wp_query;

    $big = 999999999; // need an unlikely integer

    echo paginate_links( array(
    'base' => str_replace( $big, '%#%' ),
    'format' => '?paged=%#%',
    'current' => max( 1, get_query_var('paged') ),
    'total' => $wp_query->max_num_pages
    ) );
    ?>

    If sort posts by date + in descending order, then at the end is duplicated:
    http://site/page/9?orderby=date&order=desc&order=desc

    If remove this
    , esc_url( get_pagenum_link( $big ) )
    then there will be no duplicate

    Question:
    – how to make sure that there is no duplication of this?
    – and whether it is possible to delete this parameter?
    esc_url( get_pagenum_link( $big ) )
    Is this correct and what does it do?

    Duplication when searching &order=desc
     
    #1

Share This Page

Web Hosting