Support

Home Forums Event Espresso Premium EE4, people add-on archive template

EE4, people add-on archive template

Posted: February 25, 2016 at 2:05 am


JacquesMivi

February 25, 2016 at 2:05 am

Hello,

Can I ask you an advice ?
I wish to create custom archive template for people add-on, I got Genesis and Altitude-pro theme. But I can’t find th way to do that. Should I use genesis 2.0 archive capacity ? Or create my own template ?

I try the both but without success now, so If you have a gist example it would be great.

Thanks for your help and have a good day.


Josh

  • Support Staff

February 25, 2016 at 10:26 am

If you want to create a custom archive template, you’ll need to create a template. You can follow the documentation in our wiki, and it includes some sample code:

https://eventespresso.com/wiki/build-custom-espresso-event-post-templates-genesis/#people


JacquesMivi

February 26, 2016 at 12:42 pm

Thanks a lot Josh.
Here is a code where I directly call the code that I want.

<?php
/**
* Template Name: People List
*
* This is template will display a list of your event venues 
*
* Event Registration and Management Plugin for WordPress
*
* @ package		Event Espresso
* @ author			Josh
* @ license		https://eventespresso.com/support/terms-conditions/ 
* @ link			http://www.eventespresso.com
* @ version		EE4+
* https://gist.github.com/joshfeck/ae160f5b000ef70cb7b7
*/

remove_action ( 'genesis_loop', 'genesis_do_loop' ); // Remove the standard loop
add_action( 'genesis_loop', 'custom_people_do_loop' ); // Add custom loop
remove_action( 'genesis_entry_header', 'genesis_post_meta', 12 );

function custom_people_do_loop() {  
if ( have_posts() ) :
do_action( 'genesis_before_while' );
while ( have_posts() ) : the_post();

printf( '<article %s>', genesis_attr( 'entry' ) );
do_action( 'genesis_before_entry_content' );

echo genesis_do_post_image(); //Add in featured image

printf( '<div %s>', genesis_attr( 'entry-content' ) );
echo genesis_do_post_title();
echo genesis_do_post_content();
echo '</div>';

do_action( 'genesis_after_entry_content' );
echo '</article>';
do_action( 'genesis_after_entry' );

endwhile; //* end of one post
do_action( 'genesis_after_endwhile' );
add_action( 'genesis_after_endwhile', 'genesis_posts_nav' );
else : //* if no posts exist
do_action( 'genesis_loop_else' );
endif; //* end loop
}
genesis();

Have a good week-end,

The support post ‘EE4, people add-on archive template’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso