Support » Plugin: WP-PageNavi » WP-PageNavi in On demand theme

  • Resolved gujjubond

    (@gujjubond)


    these are the codes from function.php

    // Custom Pagination Function
    function sf_pagenavi($before = ”, $after = ”, $prelabel = ”, $nxtlabel = ”, $pages_to_show = 5, $always_show = false) {
    global $request, $posts_per_page, $wpdb, $paged;
    if(empty($prelabel)) { $prelabel = ”;
    } if(empty($nxtlabel)) {
    $nxtlabel = ”;
    } $half_pages_to_show = round($pages_to_show/2);
    if (!is_single()) {
    if(!is_category()) {
    preg_match(‘#FROM\s(.*)\sORDER BY#siU’, $request, $matches); } else {
    preg_match(‘#FROM\s(.*)\sGROUP BY#siU’, $request, $matches); }
    $fromwhere = $matches[1];
    $numposts = $wpdb->get_var(“SELECT COUNT(DISTINCT ID) FROM $fromwhere”);
    $max_page = ceil($numposts /$posts_per_page);
    if(empty($paged)) {
    $paged = 1;
    }
    if($max_page > 1 || $always_show) {
    echo “$before <div id=’paginate’>Pages … “; if ($paged >= ($pages_to_show-1)) {
    echo ”; }
    previous_posts_link($prelabel);
    for($i = $paged – $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) { if ($i >= 1 && $i <= $max_page) { if($i == $paged) {
    echo “$i”;
    } else {
    echo ‘ ‘.$i.’ ‘; }
    }
    }
    next_posts_link($nxtlabel, $max_page);
    if (($paged+$half_pages_to_show) < ($max_page)) {
    echo ”; }
    echo “</div> $after”;
    }
    }
    }

    can some one edit this so it can work please ?

    http://wordpress.org/extend/plugins/wp-pagenavi/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author scribu

    (@scribu)

    Just remove all that code and replace all calls to sf_pagenavi() with wp_pagenavi() in your other theme files.

    PS: The support forums here are not “rent a coder for free”, so a little more effort on your part would be appreciated.

    @gujjubond

    The On Demand theme is a commercial theme. It simply means that most folks who help here simply don’t have access to the theme files at will.

    That being said, the On Demand theme already features a beautiful implementation of what wp-pagenavi offers. My own opinion is, that it would be a shame to spend time hacking a feature that already exists, and that already compliments the theme. That, and there may be an easier way to modify the feature so it does what you want it to. Press75 does have a support forum for those who purchase their themes. Just log on with your Press75 user id, and they should be able to offer some advice on how to make your changes. http://www.press75.com/support/

    Good luck to you!

    thank you folks …

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WP-PageNavi in On demand theme’ is closed to new replies.