Skip to content

Instantly share code, notes, and snippets.

@lorenzocaum
Created September 14, 2020 22:35
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 lorenzocaum/6eb0daad8ce58cfd83f6c6fc327d1e6a to your computer and use it in GitHub Desktop.
Save lorenzocaum/6eb0daad8ce58cfd83f6c6fc327d1e6a to your computer and use it in GitHub Desktop.
add_action( 'astra_content_before', 'my_custom_entry_hook_function', 10);

if (! function_exists( 'my_custom_entry_hook_function' )){
function my_custom_entry_hook_function() {
    if(is_post_type_archive('espresso_events')){
        add_action( 'astra_entry_content_blog', 'astra_entry_content_event_template' );
        remove_action( 'astra_entry_content_blog', 'astra_entry_content_blog_template');
#        remove_action( 'astra_entry_content_blog', array( \Astra_Loop::get_instance(),           'astra_entry_content_blog_template'));
    }
}
}

if ( ! function_exists( 'astra_entry_content_event_template' ) ) {

    function astra_entry_content_event_template() {
        get_template_part( 'template-parts/blog/event-layout' );
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment