• ewerton.lima

    (@ewertonlima)


    Newbie making a mess..
    Hi, I managed to make index.php to show prodcuts in artificer theme by copying parts of the archive-product.php to index..it work, it is showing products there but pagination fails ugly.

    mysite.com/page/2 never works..

    I tried brute mode by adding this to the end of index.php but still getting 404.

    <?
    global $wp_query;
    $big = 999999999; // need an unlikely integer
    echo paginate_links( array(
    ‘base’ => str_replace( $big, ‘%#%’, esc_url( get_pagenum_link( $big ) ) ),
    ‘format’ => ‘?paged=%#%’,
    ‘current’ => max( 1, get_query_var(‘paged’) ),
    ‘total’ => $wp_query->max_num_pages
    ) );
    ?>

    my query is doing:

    $paged = ( get_query_var( ‘paged’ ) ) ? get_query_var( ‘paged’ ) : 1;

    $args = array(
    ‘post_type’ => ‘product’,
    ‘paged’ => $paged);

    $wp_query = new WP_Query($args); ?>

  • The topic ‘How to fix pagination in artificer index.php’ is closed to new replies.