Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Dear I have wasted my week on this problem, basically when you select static page as your home page in setting->reading of wordpress the complete behavior of listing things are changed, basically static pages are never meant for pagination the fact is when you call the $paged variable it will always return zero even if you define its value to 1 the pagination will just refresh your page, because its a page not a .php valid file page is already a taxonomy function that is called in index.php of main wordpress the function will always return same thing no matter what you do,

    The work around make a index.php file copy all the content from that static page to it and then replace it with your index.php and select latest post in setting->reading of wordpress

    Now if you really don’t want to mess with it, but still want to have the pagination then you need to write a small code of yours for pagination

    basically home.com/page/2 will never work but homecom/?page=2 will always work but changing the permalink structure will change it for every one so we will create a pagination function that will call next page with home.com/?page=2

    /* ——————————————————————*/
    /* PAGINATION */
    /* ——————————————————————*/

    //paste this where the pagination must appear

    global $wp_query;
    $total = $wp_query->max_num_pages;
    // only bother with the rest if we have more than 1 page!
    if ( $total > 1 ) {
    // get the current page
    if ( !$current_page = get_query_var(‘paged’) )
    $current_page = 1;
    // structure of “format” depends on whether we’re using pretty permalinks
    if( get_option(‘permalink_structure’) ) {
    $format = ‘?paged=%#%’;
    }
    echo paginate_links(array(
    ‘base’ => get_pagenum_link(1) . ‘%_%’,
    ‘format’ => $format,
    ‘current’ => $current_page,
    ‘total’ => $total,
    ‘mid_size’ => 4,
    ‘type’ => ‘list’
    ));
    }

    if you include this rather than the current pagination you will see it working 🙂

    Thread Starter ubaidrehman

    (@ubaidrehman)

    yes it works if the perma link structure is in p= format but if its custom or potname format it doesn’t work

    Thread Starter ubaidrehman

    (@ubaidrehman)

    Ok dear I found A interesting solution which can answer millions of people having trouble with static page set on wp Pagnavi not working on it, but I don’t know how I can do it, please if you can offer a little help.

    The problem is when you try to load home.com/page/2 it redirects to home.com because the structure is not recognized if you are using a static home page in WP, what you can do is try it with home.com/?page=2 and it works like a magic ! now please help me how I can change the pagenavi to use page=2 on the main page ? is there any query I can use inside wp_pagenavi(querry here ?);

    Thread Starter ubaidrehman

    (@ubaidrehman)

    yes it seems to be like that but I thought you might have face and found a solution for this kind of trouble well what your best knowledge says about it ?

    Thread Starter ubaidrehman

    (@ubaidrehman)

    any plugin will also be appreciated.

    Thread Starter ubaidrehman

    (@ubaidrehman)

    Thanks alot. dear you are a great help.

    Thread Starter ubaidrehman

    (@ubaidrehman)

    Thanks esmi for showing this way – that will be a great way – but I have to make sme manual coding to make user switch to new page every time he register with a sub-domain – and that’s what I want in theme function might be posible there is a theme.

Viewing 7 replies - 1 through 7 (of 7 total)