Portfolio – Pagination?

  • Posted in : Responsy WP
  • ismacuasni
    Participant

    Hi!

    Its posible to add a pagination to portfolio page. See http://www.plafo.com/new/?page_id=55
    I have a lot of projects.

    Thanks

    Isma

    Mehmet S.
    Keymaster

    Hi,

    we are working to add.

    ismacuasni
    Participant

    ok! Please let me know when you finish that.

    Thanks

    Isma

    goodhelp
    Participant

    Hi
    have you finished the pagination in the portfolio?

    Gino

    Mehmet S.
    Keymaster

    Not yet, but I will have that in mind for a next update.

    goodhelp
    Participant

    I have already solved

    In function.php add this function

    function my_pagination($pages = ”, $range = 2)
    {
    $showitems = ($range * 2)+1;

    global $paged;
    if(empty($paged)) $paged = 1;

    if($pages == ”)
    {
    global $wp_query;
    $pages = $wp_query->max_num_pages;
    if(!$pages)
    {
    $pages = 1;
    }
    }

    if(1 != $pages)
    {
    echo “”;
    if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<<“;
    if($paged > 1){echo “<“;}else{echo “<“;}

    for ($i=1; $i = $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))
    {
    echo ($paged == $i)? "“.$i.”“:”“.$i.”“;
    }
    }

    if ($paged < $pages){echo ">“;}else{echo “>“;}
    if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo ">>“;
    echo “\n”;
    }
    }”

    Then in file portfolio.php change this at line 102

    “$args_portfolio = array( ‘post_type’ => ‘portfolio’, ‘posts_per_page’ => -1 );”

    in

    “$args_portfolio = array( ‘post_type’ => ‘portfolio’, ‘posts_per_page’ => 9, ‘paged’ => $paged );”

    9 = number of item that you would show per page

    and add this line

    “my_pagination($loop_portfolio->max_num_pages);”
    where do you want to appear the pagination

    Bye

    Mehmet S.
    Keymaster

    Thanks.

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

The forum ‘Responsy WP’ is closed to new topics and replies.