Last active
August 29, 2015 14:14
-
-
Save Magnacarter/71d33b14952008d84e98 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Template Name: Home | |
*/ | |
/** | |
* Remove the Genesis custom loop and add custom template | |
* | |
* @action genesis_loop | |
* | |
* @return void | |
*/ | |
function rjs_portfolio_loop() { | |
$args = array( | |
'post_type' => 'portfolio', | |
); | |
$portfolio = new WP_Query( $args ); | |
?> | |
<div class="projects"> | |
<?php if ( $portfolio->have_posts() ) : ?> | |
<?php while ( $portfolio->have_posts() ) : $portfolio->the_post() ?> | |
<div class="project one-half"> | |
<div class="project-image one-half"> | |
<img src="<?php echo esc_url( get_the_field( 'project_image' ) ) ?>" height="600" width="600" /> | |
</div> | |
</div> | |
<?php endwhile; ?> | |
<?php endif; ?> | |
</div> | |
<?php | |
wp_reset_postdata(); | |
} | |
remove_action('genesis_loop', 'genesis_do_loop'); | |
add_action('genesis_loop', 'rjs_portfolio_loop'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment