Jurado Shortcode
// Add Shortcode
function jurado_shortcode() {
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'jgc_genesis_custom_loop' );
function jgc_genesis_custom_loop() {
global $post;
$args = array(
'posts_per_page' => 6,
'post_type' => 'jurado_imt',
'post_status' => 'publish'
);
$myposts = get_posts( $args );
foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
<article class="home-post">
<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<p><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a></p>
<p class="home-excerpt"><?php the_excerpt(); ?></a></p>
</article>
<?php endforeach;
wp_reset_postdata();
?>
<div class="home-cta">
<a class="button">Ver más</a>
</div>
<?php
}
}
add_shortcode( 'jurado', 'jurado_shortcode' );