Skip to content

Instantly share code, notes, and snippets.

@dcooney
Last active October 16, 2020 13:27
Show Gist options
  • Select an option

  • Save dcooney/dafd4099ce4be1ba832b8931df0beb9b to your computer and use it in GitHub Desktop.

Select an option

Save dcooney/dafd4099ce4be1ba832b8931df0beb9b to your computer and use it in GitHub Desktop.
Genesis Archive with Ajax Load More
<?php
/**
* Genesis Framework.
*
* Custom Archive Template.
*
* @package Genesis\Templates
* @author ConnektMedia
* @license GPL-2.0+
* @link http://my.studiopress.com/themes/genesis/
*/
get_header();
/**
* Fires after the header, before the content sidebar wrap.
*
* @since 1.0.0
*/
do_action( 'genesis_before_content_sidebar_wrap' );
genesis_markup(
[
'open' => '<div %s>',
'context' => 'content-sidebar-wrap',
]
);
/**
* Fires before the content, after the content sidebar wrap opening markup.
*
* @since 1.0.0
*/
do_action( 'genesis_before_content' );
genesis_markup(
[
'open' => '<main %s>',
'context' => 'content',
]
);
/**
* Fires before the loop hook, after the main content opening markup.
*
* @since 1.0.0
*/
do_action( 'genesis_before_loop' );
// Custom Connekt Loop
if ( have_posts() ) {
/**
* Fires inside the standard loop, before the while() block.
*
* @since 2.1.0
*/
do_action( 'genesis_before_while' );
echo do_shortcode('[ajax_load_more archive="true"]');
do_action( 'genesis_after_endwhile' );
} else { // If no posts exist.
/**
* Fires inside the standard loop when they are no posts to show.
*
* @since 1.0.0
*/
do_action( 'genesis_loop_else' );
} // End loop.
// End Custom Connekt Loop
/**
* Fires after the loop hook, before the main content closing markup.
*
* @since 1.0.0
*/
do_action( 'genesis_after_loop' );
genesis_markup(
[
'close' => '</main>', // End .content.
'context' => 'content',
]
);
/**
* Fires after the content, before the main content sidebar wrap closing markup.
*
* @since 1.0.0
*/
do_action( 'genesis_after_content' );
genesis_markup(
[
'close' => '</div>',
'context' => 'content-sidebar-wrap',
]
);
/**
* Fires before the footer, after the content sidebar wrap.
*
* @since 1.0.0
*/
do_action( 'genesis_after_content_sidebar_wrap' );
get_footer();
<?php
/**
* Fires inside the standard loop, before the entry opening markup.
*
* @since 2.0.0
*/
do_action( 'genesis_before_entry' );
genesis_markup(
[
'open' => '<article %s>',
'context' => 'entry',
]
);
/**
* Fires inside the standard loop, to display the entry header.
*
* @since 2.0.0
*/
do_action( 'genesis_entry_header' );
/**
* Fires inside the standard loop, after the entry header action hook, before the entry content.
* opening markup.
*
* @since 2.0.0
*/
do_action( 'genesis_before_entry_content' );
genesis_markup(
[
'open' => '<div %s>',
'context' => 'entry-content',
]
);
/**
* Fires inside the standard loop, inside the entry content markup.
*
* @since 2.0.0
*/
do_action( 'genesis_entry_content' );
genesis_markup(
[
'close' => '</div>',
'context' => 'entry-content',
]
);
/**
* Fires inside the standard loop, before the entry footer action hook, after the entry content.
* opening markup.
*
* @since 2.0.0
*/
do_action( 'genesis_after_entry_content' );
/**
* Fires inside the standard loop, to display the entry footer.
*
* @since 2.0.0
*/
do_action( 'genesis_entry_footer' );
genesis_markup(
[
'close' => '</article>',
'context' => 'entry',
]
);
/**
* Fires inside the standard loop, after the entry closing markup.
*
* @since 2.0.0
*/
do_action( 'genesis_after_entry' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment