Support

Home Forums Event Espresso Premium Website footer disappeared after editing single event template

Website footer disappeared after editing single event template

Posted: February 23, 2021 at 3:32 am


SmartPrep

February 23, 2021 at 3:32 am

Hi there

I had some previous support on editing my custom single event template. I managed to successfully edit it, but I realised that in doing so, my website’s footer no longer displays when viewing events. My PHP skills are limited, so I may have deleted something erroneously and now don’t know how to fix it. Please can you assist. I assume there is a small snippet I can add to display the footer again?

Thanks in advance


Tony

  • Support Staff

February 23, 2021 at 5:50 am

Hi there,

Can you post the contents of your single-espresso_events.php template to a Gist or PasteBin again so I can take a look?

I’m guessing your now missing the_footer(); at the bottom of the template.


SmartPrep

February 23, 2021 at 5:54 am

This reply has been marked as private.


Tony

  • Support Staff

February 23, 2021 at 6:34 am

There’s a fair bit ‘wrong’ in that template, are you sure that is the correct template file?

There’s no call to wp_head() in that template, which means non of your sites scripts/styles would be loading, yet they are on your single events.


SmartPrep

February 23, 2021 at 7:13 am

Hi Tony

Yeah I’m sure that’s the correct file. When saved, the changes do reflect. The only thing I changed on that file recently was the code you gave me from a previous support thread to re-order the main description and excerpt

<header class="event-header">
    <?php echo "<h1 id=\"event-details-{$tag}-{$post->ID}\" class=\"entry-title\">"; ?>
        <a class="ee-event-header-lnk" href="<?php the_permalink(); ?>"<?php echo \EED_Events_Archive::link_target();?>>
            <?php the_title(); ?>
        </a>
    </h1>
</header>
<?php espresso_get_template_part( 'content', 'espresso_events-details' ); ?>
<?php espresso_get_template_part( 'content', 'espresso_events-tickets' ); ?>
<div class="event-details-excerpt">
    <?php the_excerpt(); ?>
</div>

Please let me know if you can assist me further in correcting the template.
Would be greatly appreciated

Kind Regards


Tony

  • Support Staff

February 23, 2021 at 7:46 am

If that’s the only change you made then the footer can’t have been loading previously as that code change doesn’t touch the footer.

A correction for my above comment, your template does indeed call get_header() (which in turn must be calling wp_head()) PasteBin has that code highlighted green so I simply read it as comments, my mistake.

I can give you some pointers on what I can see from your template, but even after fixing this, you may need some deeper investigation as you may end up with mismatched elements on the page (e.g additional opening/closing divs).

Backup the current file just incase before moving forward.

Your loading a header (which will open the HTML doc and likely the body), but then restarting the HTML document again on line 16 and additional output through to line 21 so start by removing those lines, they aren’t valid.

Then from the end of the template remove:

</body>
</html>

In place of those 2, use <?php get_footer(); ?>

Does the page load correctly now?


SmartPrep

February 23, 2021 at 1:11 pm

That fixed it. Thanks kindly Tony!


Tony

  • Support Staff

February 24, 2021 at 4:56 am

You’re most welcome.

Another quick fix I recommend is, on Line 57 of the PasteBin you linked to, add </h1> right after the closing a tag (</a>).

The support post ‘Website footer disappeared after editing single event 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