Hi Wes,
Now that G2.0 standard loop no longer uses $loop_counter variable when outputting HTML5, what’s your official fix for this?
I searched but couldn’t find anything specific posted here, so in the meantime (for info) here’s what I do:
1. In page_portfolio.php change this:
add_action( 'genesis_entry_footer', 'portfolio_after_post' );
to this:
add_action( 'genesis_after_entry', 'portfolio_after_post' );
2. Also in page_portfolio.php change this:
function portfolio_after_post() {
global $loop_counter;
if ( $loop_counter == 3 ) {
$loop_counter = -1;
echo '<div class="clear"></div>';
}
}
to this:
function portfolio_after_post() {
global $wp_query;
// Assumes 4 posts per row
$end_row = ( $wp_query->current_post + 1 ) / 4;
if ( ctype_digit( (string) $end_row ) ) {
echo '<div class="clear"></div>';
}
}
Also, a suggestion to make re-use of Portfolio functionality elsewhere in the theme easier in future themes/releases – move all functions to functions.php and only leave the action and filter calls in the page template. This then makes it really easy to create a Category archive display using the portfolio, or the home page, etc.
Finally, loving this theme by the way – really cool work.
Cheers,
Ade Walker