Front page with pagination

HI,
i’m trying to show some posts on my front page with the pagination, but i still have an error:
when i go to the second page through the pagination i have always the first link as current; and i can’t go back to the first page.
this is the code of my front-page.php

<?php get_template_part('templates/content', 'homepage'); ?>

i put this function in custom.php

function vb_pagination( $query=null ) {

global $wp_query;
$query = $query ? $query : $wp_query;
$big = 999999999;

$paginate = paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'type' => 'array',
'total' => $query->max_num_pages,
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'prev_text' => __('&laquo;'),
'next_text' => __('&raquo;'),
 )
 );

if ($query->max_num_pages > 1) :
?> 
<ul class="pagination">
<?php
foreach ( $paginate as $page ) {
echo '<li>' . $page . '</li>';
}
?>
</ul>
<?php
 endif;
}

and this is my content-homepage.php

http://pastebin.com/DYTTbXZ7

thanks for any help.

yeah

no one can help me?

thanks

Have you tried your code outside of Roots?

hi,
yes i tried. and it works.

Have you tried it on a different template in Roots? The query is set up differently in front-page.php, depending on the reading settings in the dashboard.

Hi,
i tried the code in the custom template and the pagination works perfectly.
about the reading settings in dashboard: i have the static page selected and the last 9 posts.

is there an alternative?

thank you

Have you tried the advice from the Codex?

ohhhh!!! finally!!!
i solved it!

this is the right code:

<?php

if ( get_query_var('paged') ) {
$paged = get_query_var('paged');
} else if ( get_query_var('page') ) {
$paged = get_query_var('page');
} else {
$paged = 1;
}

$my_args = array(
'post_type' => 'auto',
'posts_per_page' => 6,
'paged' => $paged
 );

 query_posts( $my_args );

?>

<?php if ( have_posts() ) : while (have_posts()) : the_post(); ?>

thank you!