Support

Home Forums Event Espresso Premium Source code from event descirption

Source code from event descirption

Posted: May 12, 2016 at 9:07 am


Zuckerbaeckerei

May 12, 2016 at 9:07 am

Hi

I need to create multiple <div>’s around the event description and its content. There is also an image in the event description which needs an own <div> tag around itself.

http://www.fotos-hochladen.net/uploads/18l92ywk73x.png

The question:
Where can I find the right place (source code) to create these div’s?
I can’t find the files and the function where the description and its content gets displayed.

Thanks in advance


Josh

  • Support Staff

May 12, 2016 at 9:56 am

The simplest place to add these, especially for around the image that’s within the description, is right in the text editor when you edit the event.

If you want to programmatically wrap the entire event description in div tags, there are a few hooks that you can use. Here’s an example that you can add to your site:

function my_before_event_description() {
	echo '<div class="description">';
}
add_action( 'AHEE_event_details_before_the_content', 'my_before_event_description' );

function my_after_event_description() {
	echo '</div><!-- end .description -->';
}
add_action( 'AHEE_event_details_after_the_content', 'my_after_event_description' );

You can add the above to a functions plugin or into your WordPress theme’s functions.php file.


Zuckerbaeckerei

May 13, 2016 at 8:37 am

Thanks for the quick response.
I tried both solutions out.

The first one worked just fine however I don’t want to write these <div>’s every time I set up a new event. I know you can duplicate an event so you don’t have to create everything again. However I’m not completely happy with this solution.
Here is the result I got with it
In the <div class=”ym-g66 ym-gl”> container you can see that I need to put multiple tags around the text and around the image.

The second option with the two functions didn’t solve the problem because the <div>’s are around the whole event-content (also around the information-box on the right side with “price, time” etc.) and I just want to have it around the text and the image.

Isn’t there one function that displays the event-description text only (and one for images) where i can put my <div> tags around?

Thanks in advance


Josh

  • Support Staff

May 13, 2016 at 8:47 am

There is, but it looks like you’ve customized things a bit so I can only guess where that would be. If you can post the template code that you’re working with for the event page I can take a look and try to figure it out. Can you post to a paste bin or gist and link to the code here?


Zuckerbaeckerei

May 13, 2016 at 8:58 am

I’m working with a theme called Divi.

This is the template for the page:
https://gist.github.com/anonymous/b3373921981265088200610e5c3159c2

I’m not sure if this is enough.
Please let me know if you need something else or more.


Josh

  • Support Staff

May 13, 2016 at 10:58 am

That doesn’t look like the right template because the markup on the page you linked to doesn’t match the markup in the template.

In any case, you can do a search in your theme files for the ym-gbox html class (outlined in this screenshot). That’s where you’ll add the extra div markup.

The support post ‘Source code from event descirption’ 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