Skip to content

Instantly share code, notes, and snippets.

@photoaddictsa
Created September 22, 2017 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save photoaddictsa/2343851119a91523940de538a831ac57 to your computer and use it in GitHub Desktop.
Save photoaddictsa/2343851119a91523940de538a831ac57 to your computer and use it in GitHub Desktop.
Custom loop in genesis archive
<?php
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'your_custom_loop' );
// Remove custom structural wraps.
remove_action( 'genesis_before_content_sidebar_wrap', 'studio_wrap_open', 6 );
remove_action( 'genesis_after_content_sidebar_wrap', 'studio_wrap_close', 13 );
function your_custom_loop() {
if(have_posts()) : while(have_posts()) : the_post();
echo '<article class="entry">';
echo '<div class="entry-content">';
echo '<div class="won_by">';
get_field('team_won_by_x_runs');
echo '</div>';
echo '<ul class="tvst">';
echo '<li class="team1">';
echo '<img src="' . get_field('team_1_photo') . '" alt="" />';
echo '<span class="runswwickets">' . get_field('team_1_runs_wickets') . '</span>';
echo '</li>';
echo '<li class="vs">';
echo '<h3 class="teamname">' . get_field('team_1') . '</h3>';
echo '<em class="vs">' . VS . '</em>';
echo '<h3 class="teamname">' . get_field('team_2') . '</h3>';
echo '<div class="date-venue">';
echo '<div class="date">';
get_field('date'); echo '<em>(GMT+2)</em>';
echo '</div>';
echo '<div class="venue">';
get_field('venue');
echo '</div>';
echo '</li>';
echo '<li class="team2">';
echo '<img src="' . get_field('team_2_photo') . '" alt="" />';
echo '<span class="runswwickets">' . get_field('team_2_runs_wickets') . '</span>';
echo '</li>';
echo '</ul>';
echo '</div>';
echo '</div>';
echo '</article>';
endwhile; endif;
}
genesis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment