Portfolio display issue fix?

Homepage Community Forums Epik Theme Support Portfolio display issue fix?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #7013
    adew
    Customer

      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

      #7014
      adew
      Customer

        Wes,
        I’ve got some other comments about the Portfolio markup too. If you wish, you can contact me at ade at studiograsshopper.ch.
        Cheers,
        Ade

        #7018
        Wes
        Moderator

          Wow, this is crazy, I was just getting ready to ask the SP Community if someone had a fix for the loop_counter part. You came right on time! I’ve been trying to figure that out for a while now, so I appreciate it.

          I’ll send you an email

          #7023
          adew
          Customer

            LOL – things happen like that sometimes. 馃檪

            Email received. Cheers!

          Viewing 4 posts - 1 through 4 (of 4 total)
          • You must be logged in to reply to this topic.