-
-
Save DavidPeralvarez/bda3faf98f2c935a844760f8321987fb to your computer and use it in GitHub Desktop.
Lección #12 del curso: CSS Grid
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 | |
// Add header | |
add_action( 'genesis_before_content_sidebar_wrap', 'scv_home_jumbotron' ); | |
function scv_home_jumbotron(){ | |
?> | |
<div class="jumbotron"> | |
<h1>Viajes al centro de la Tierra</h1> | |
<p>Te invito a descubrir junto con Willy Fog las mejores rutas en el centro de la Tierra.</p> | |
</div> | |
<?php | |
} | |
// Remove Genesis loop and add custom loop | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
add_action( 'genesis_loop', 'scv_do_loop' ); | |
function scv_do_loop(){ | |
$args = array( | |
'post_type' => 'post', | |
'posts_per_page' => -1 | |
); | |
$home_query = new WP_Query($args); | |
if($home_query->have_posts()): | |
echo '<ul class="travel-posts">'; | |
while($home_query->have_posts()): $home_query->the_post(); | |
?> | |
<li style="background-image: url(<?php echo get_the_post_thumbnail_url( get_the_ID(), 'medium_large'); ?>);"> | |
<a href="<?php the_permalink(); ?>"> | |
<div class="travel-details"> | |
<h2><?php the_title(); ?></h2> | |
</div> | |
</a> | |
</li> | |
<?php | |
endwhile; | |
echo '</ul><!-- .travel-posts -->'; | |
endif; | |
wp_reset_postdata(); | |
} | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment