Support

Home Forums Event Espresso Premium Background image missing on transaction page, but not on cart page

Background image missing on transaction page, but not on cart page

Posted: November 20, 2013 at 2:58 pm


Ross Willits

November 20, 2013 at 2:58 pm

Yesterday I was testing some changes to our checkout questions, and noticed that the background image on the transaction page was missing.

The image appears properly on all other EE pages, but when I look at the source for the page where it’s missing there are directory markers missing in the image URL.

In other words, on the Register page, the source lists the bg image URL as “../../wp-content/images…” but on the Transaction page, the URL source is simply “wp-content/images…” and that would be why it can’t find the image.

What I cannot figure out is where in the Event Espresso theme is the image defined, and how can I fix it for the transaction page without breaking it for any other page?

I’m new to php, so I don’t quite understand how the php info gets translated into the html pages that the customer sees.

At any rate, the URL to look at is: https://www.steppingstonetheatre.org/about/event-registration/?ee=137

This is the event info page. This one works. If you click to “Select this Class” you’ll go to a shopping cart page, which also works. Please add a student and choose “Enter Attendee Info” to see the transaction page that doesn’t work.

WP and EE and all plug-ins are up to date. I had just started to use the “Modify Price” add-on when I noticed the error, but I don’t know if that has any relevance.

Thank you.


Josh

  • Support Staff

November 20, 2013 at 3:58 pm

Hi there,

I checked and it would likely be best to use the get_template_directory WordPress function to point to the theme directory in your theme instead of hardcoding in a relative path to the image. So in your theme’s template instead of:

<div id="bg"><img src="../../wp-content/themes/steppingstonetheatre/images/bg.jpg" alt=""></div>

You’d do:

<div id="bg"><img src="<?php get_template_directory(); ?>/images/bg.jpg" alt=""></div>


Ross Willits

November 20, 2013 at 4:18 pm

Thanks for the response.

I looked at the theme, and the code that was there for the bg image was

<div id="bg"><img src="<?php echo $leader; ?>wp-content/themes/steppingstonetheatre/images/bg.jpg" alt=""></div>

There were $leader functions above to get the proper # of “../”, but again, for whatever reason, it didn’t work.

However, your suggestion prompted me to hardcode the full URL to the image, and that seems to have worked just fine.

Thank you for your help. I have a couple of other questions, but I’ll ask them in a different thread.

Ross

The support post ‘Background image missing on transaction page, but not on cart page’ 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