Posted: January 28, 2021 at 10:53 am
Hi, I am currently editing my theme’s single.php in order to design the single events page, and doing all of this in my child theme. I know EE hooks into the_content() to display its template. I want to display my event description as well as its featured image side by side and would normally use a flexbox container to do that.
in my single.php file I end up with
I end up with all the other elements such as datetimes and ticket selector nested under the event-content div. The description’s text doesn’t belong to any container anymore. If I do the same thing but this time with
I get the result expected and can display the datetimes template out. What am I doing wrong here? |
|
Here is a better looking code on pastebin: To note, I have the display selector activated in admin. Here is a link to a single event page: |
|
Hi there, Did you create a copy of your https://developer.wordpress.org/themes/basics/template-hierarchy/ Or have you added a conditional to your I’m guessing the latter as then by default EE won’t inject the additional details into the_conent() as it is expected that you will be takin over the output, but before moving forward can you let me know where that above code is located? |
|
Hi Tony, At this stage, I’m using the single.php template. Our website doesn’t have any other type of posts than events, we use pages for the rest, so I thought I could simply edit that one. Let me know what are your thoughts! |
|
You ‘can’ just edit single.php, however, Event Espresso explicitly checks for
A conditional such as:
Or:
Using single-espresso_events.php avoids the need for this as it will only be loaded for EE events. You said you haven’t added any code, but in your opening post, you state your adding code? See:
|
|
Hi Tony, Ok, I have started using the single-espresso_events.php. This doesn’t help me with my original issue: I still can’t select the event’s description. |
|
Within Can you share your To get the event description within that template you just need to call |
|
Hi, I solved this over the weekend! My issue was that I had the filters in my child theme’s function.php from this resource All good now, thank you! |
|
The support post ‘Single event page – Can't target event description’ 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.