Support

Home Forums Event Espresso Premium Create an archive template but new events are now showing differently

Create an archive template but new events are now showing differently

Posted: October 1, 2020 at 4:30 am


InfinityBC

October 1, 2020 at 4:30 am

Hi I’ve been through – https://eventespresso.com/wiki/ee4-custom-post-types/#archive_event_template and created a new archive template. Adding a different title and a company logo.

https://www.the-ta.com/upcoming-events/

The new template has though changed the layouts of new events in the archive list.

I didn’t change any of the other code. Really stuck and scratching my head.

Here is the code form the template file below. Thanks so much in advance guys.

Regards

Mark

<?php
/**
* The template for displaying archive pages
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package BuddyBoss_Theme
*/

get_header();

$blog_type = ‘standard’; // standard, grid, masonry.
$blog_type = apply_filters( ‘bb_blog_type’, $blog_type );

$class = ”;

if ( ‘masonry’ === $blog_type ) {
$class = ‘bb-masonry’;
} elseif ( ‘grid’ === $blog_type ) {
$class = ‘bb-grid’;
} else {
$class = ‘bb-standard’;
}
?>

<div id=”primary” class=”content-area”>
<main id=”main” class=”site-main”>

<?php if ( have_posts() ) : ?>
<header class=”page-header”>
<?php
the_archive_title( ‘<h1 class=”page-title”>’, ‘</h1>’ );
the_archive_description( ‘<div class=”archive-description”>’, ‘</div>’ );
?>
</header><!– .page-header –>

<div class=”container”>
<table id=”notes”>
<tr>
<td>

<h2 class=”eventtitle” align=”left”><br>Upcoming Events </h2>
<div class=”notice”><?php echo wpautop( $invoice->notes ); ?></div>
</td>
<td>
<div class=”eventlogo”>
Egyption Chamber of Commerce Logo
</div></td>
</tr>
</table>

</div>

<div class=”post-grid <?php echo esc_attr( $class ); ?>”>

<?php if ( ‘masonry’ === $blog_type ) { ?>
<div class=”bb-masonry-sizer”></div>
<?php } ?>

<?php
/* Start the Loop */
while ( have_posts() ) :
the_post();

/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( ‘template-parts/content’, apply_filters( ‘bb_blog_content’, get_post_format() ) );

endwhile;
?>
</div>

<?php
buddyboss_pagination();

else :
get_template_part( ‘template-parts/content’, ‘none’ );
?>

<?php endif; ?>

</main><!– #main –>
</div><!– #primary –>

<?php get_sidebar(); ?>

<?php
get_footer();


InfinityBC

October 1, 2020 at 4:33 am

Hi I’ve been through – https://eventespresso.com/wiki/ee4-custom-post-types/#archive_event_template and created a new archive template. Adding a different title and a company logo.

https://www.the-ta.com/upcoming-events/

The new template has though changed the layouts of new events in the archive list losing the View more, date and view details.

I didn’t change any of the other code. Really stuck and scratching my head.

Here is the code form the template file below. Thanks so much in advance guys.

Regards

Mark

<?php
/**
* The template for displaying archive pages
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package BuddyBoss_Theme
*/

get_header();

$blog_type = ‘standard’; // standard, grid, masonry.
$blog_type = apply_filters( ‘bb_blog_type’, $blog_type );

$class = ”;

if ( ‘masonry’ === $blog_type ) {
$class = ‘bb-masonry’;
} elseif ( ‘grid’ === $blog_type ) {
$class = ‘bb-grid’;
} else {
$class = ‘bb-standard’;
}
?>

<div id=”primary” class=”content-area”>
<main id=”main” class=”site-main”>

<?php if ( have_posts() ) : ?>
<header class=”page-header”>
<?php
the_archive_title( ‘<h1 class=”page-title”>’, ‘</h1>’ );
the_archive_description( ‘<div class=”archive-description”>’, ‘</div>’ );
?>
</header><!– .page-header –>

<div class=”container”>
<table id=”notes”>
<tr>
<td>

<h2 class=”eventtitle” align=”left”><br>Upcoming Events </h2>
<div class=”notice”><?php echo wpautop( $invoice->notes ); ?></div>
</td>
<td>
<div class=”eventlogo”>
Egyption Chamber of Commerce Logo
</div></td>
</tr>
</table>

</div>

<div class=”post-grid <?php echo esc_attr( $class ); ?>”>

<?php if ( ‘masonry’ === $blog_type ) { ?>
<div class=”bb-masonry-sizer”></div>
<?php } ?>

<?php
/* Start the Loop */
while ( have_posts() ) :
the_post();

/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( ‘template-parts/content’, apply_filters( ‘bb_blog_content’, get_post_format() ) );

endwhile;
?>
</div>

<?php
buddyboss_pagination();

else :
get_template_part( ‘template-parts/content’, ‘none’ );
?>

<?php endif; ?>

</main><!– #main –>
</div><!– #primary –>

<?php get_sidebar(); ?>

<?php
get_footer();


Tony

  • Support Staff

October 1, 2020 at 4:58 am

Hi there,

Sounds like your theme may be using a different template than the one you copied.

Which template did you copy to create archive-espresso_events.php?

Rename that template to something other than the above, add a ‘2’ or ‘temp’ to the filename:

archive-espresso_events2.php or archive-espresso_events-temp.php

That will deactivate your template and switch back to whatever your theme used normally, let me know when that has been done and I’ll take a look at the page to see if anything stands out.


InfinityBC

October 1, 2020 at 5:27 am

Hi there is used the file – archive.php

I-ve changes the new template file to archive-espresso_events-temp.php

It’s taken off the Title and logo I’ve added to the template but the new test events still have the different layouts – https://www.the-ta.com/upcoming-events/

Thanks for having a look.

Regards

Mark


InfinityBC

October 1, 2020 at 6:08 am

So it can’t be the template file. Now im really scratching my head ๐Ÿ™‚


Tony

  • Support Staff

October 1, 2020 at 8:41 am

Ok, so the only change you’ve made is to copy the archive.php template and add this code:

add_filter( 'FHEE__EED_Event_Archive__template_include__allow_custom_selected_template', '__return_true' );

to your theme’s functions.php file?

The template is currently renamed, right?

So, now comment out the above code (add // at the beginning) meaning you’ve now removed all of the modifications and then see if the output returns to how it was before?


InfinityBC

October 1, 2020 at 10:13 am

Hi,

I’m at the point again and it’s still wrong so not a template problem.

Do you have other ideas?

Its strange the old one works ok but its only new ones. I brought an old event back – Retail & E-Commerce in Egypt and that workes fin in the archive.

Thanks for your help.

Regards


Tony

  • Support Staff

October 1, 2020 at 10:36 am

Ok so this can’t be from changing the template then as all of that has now been removed.

Does your theme add options to each individual EE event when you edit the event?


InfinityBC

October 1, 2020 at 11:26 am

OK figured it out. Phew, the client was adding some text into the Excerpt and that was hijacking the Preview in Archive view.

Sorry, we went so far from that, thanks for bearing with me and getting me there.


Tony

  • Support Staff

October 1, 2020 at 11:52 am

Ahhh, yeah ok. That makes sense now.

Glad you found it ๐Ÿ™‚

You must be logged in to reply to this support post. Sign In or Register for an Account

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3 Documentation for Event Espresso 4

Status: publish

Updated by  Tony 3 weeks, 4 days ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!
[gravityform id=80 title=false description=false ajax=false]
<div class='gf_browser_unknown gform_wrapper' id='gform_wrapper_80' ><form method='post' enctype='multipart/form-data' id='gform_80' action='/topic/create-an-archive-template-but-new-events-are-now-showing-differently/'> <div class='gform_body'><ul id='gform_fields_80' class='gform_fields top_label form_sublabel_below description_below'><li id='field_80_1' class='gfield gfield_contains_required field_sublabel_below field_description_below gfield_visibility_visible' ><label class='gfield_label' for='input_80_1' >First name<span class='gfield_required'>*</span></label><div class='ginput_container ginput_container_text'><input name='input_1' id='input_80_1' type='text' value='' class='medium' aria-required="true" aria-invalid="false" /></div></li><li id='field_80_2' class='gfield gfield_contains_required field_sublabel_below field_description_below gfield_visibility_visible' ><label class='gfield_label' for='input_80_2' >Email address<span class='gfield_required'>*</span></label><div class='ginput_container ginput_container_email'> <input name='input_2' id='input_80_2' type='email' value='' class='medium' aria-required="true" aria-invalid="false" /> </div></li><li id='field_80_3' class='gfield gfield_contains_required field_sublabel_below field_description_below gfield_visibility_visible' ><label class='gfield_label' >GDPR Agreement<span class='gfield_required'>*</span></label><div class='ginput_container ginput_container_checkbox'><ul class='gfield_checkbox' id='input_80_3'><li class='gchoice_80_3_1'> <input name='input_3.1' type='checkbox' value='I consent to have this website store my submitted information so they can respond to my inquiry.' id='choice_80_3_1' /> <label for='choice_80_3_1' id='label_80_3_1'>I consent to have this website store my submitted information so they can respond to my inquiry.</label> </li></ul></div></li><li id='field_80_4' class='gfield gform_validation_container field_sublabel_below field_description_below gfield_visibility_visible' ><label class='gfield_label' for='input_80_4' >Name</label><div class='ginput_container'><input name='input_4' id='input_80_4' type='text' value='' autocomplete='off'/></div><div class='gfield_description' id='gfield_description_80_4'>This field is for validation purposes and should be left unchanged.</div></li> </ul></div> <div class='gform_footer top_label'> <input type='submit' id='gform_submit_button_80' class='gform_button button' value='Download Now' onclick='if(window["gf_submitting_80"]){return false;} if( !jQuery("#gform_80")[0].checkValidity || jQuery("#gform_80")[0].checkValidity()){window["gf_submitting_80"]=true;} ' onkeypress='if( event.keyCode == 13 ){ if(window["gf_submitting_80"]){return false;} if( !jQuery("#gform_80")[0].checkValidity || jQuery("#gform_80")[0].checkValidity()){window["gf_submitting_80"]=true;} jQuery("#gform_80").trigger("submit",[true]); }' /> <input type='hidden' class='gform_hidden' name='is_submit_80' value='1' /> <input type='hidden' class='gform_hidden' name='gform_submit' value='80' /> <input type='hidden' class='gform_hidden' name='gform_unique_id' value='' /> <input type='hidden' class='gform_hidden' name='state_80' value='WyJbXSIsIjBiNjdjZjkyMDUzOWUxOWY5Y2NiZjIwMzM4YjA1Mjk4Il0=' /> <input type='hidden' class='gform_hidden' name='gform_target_page_number_80' id='gform_target_page_number_80' value='0' /> <input type='hidden' class='gform_hidden' name='gform_source_page_number_80' id='gform_source_page_number_80' value='1' /> <input type='hidden' name='gform_field_values' value='' /> </div> </form> </div><script type='text/javascript'> jQuery(document).bind('gform_post_render', function(event, formId, currentPage){if(formId == 80) {} } );jQuery(document).bind('gform_post_conditional_logic', function(event, formId, fields, isInit){} );</script><script type='text/javascript'> jQuery(document).ready(function(){jQuery(document).trigger('gform_post_render', [80, 1]) } ); </script>
[i]
[i]