Skip to content

Instantly share code, notes, and snippets.

@kadimi
Last active July 13, 2019 17:32
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 kadimi/37c60dfc488c7ec7ab27f9799c320482 to your computer and use it in GitHub Desktop.
Save kadimi/37c60dfc488c7ec7ab27f9799c320482 to your computer and use it in GitHub Desktop.
SportsPress events archive template using event blocks
<?php
/**
* The template for displaying archive pages.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package Rookie
*/
get_header(); ?>
<div id="primary" class="content-area content-area-<?php echo rookie_get_sidebar_setting(); ?>-sidebar">
<main id="main" class="site-main" role="main">
<?php if ( have_posts() ) : ?>
<header class="page-header entry-header">
<?php
the_archive_title( '<h1 class="page-title entry-title">', '</h1>' );
the_archive_description( '<div class="taxonomy-description">', '</div>' );
?>
</header><!-- .page-header -->
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php echo do_shortcode( '[event_blocks event="' . get_the_ID() . '"]' ); ?>
<?php endwhile; ?>
<?php if ( function_exists( 'rookie_paging_nav') ) rookie_paging_nav(); ?>
<?php else : ?>
<?php get_template_part( 'content', 'none' ); ?>
<?php endif; ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment