Posted: June 7, 2017 at 2:52 am
I’m trying to use the snippet given by Tony in a previous Q on this subject. Where do I put it? I’ve created a function in my child theme with that content. Is that right? But then how do I make use of it? |
|
Hi there, Which snippet are you referring to? I have a lot of snippets so just want to be sure I’m looking at the same one. Can you post the link here so I can take a look? |
|
The snippet linked in that post uses a hook within EE4 so if you have added it to your themes functions.php file it should already be in use. What it does is add a list of events to the venue page, so if you view the venue you page you should see a section that now lists any events assigned to that venue. |
|
I’ve added the function to functions.php in my child theme but see no effect. The problem ist that my venues page isn’t working properly, as you know (See https://eventespresso.com/topic/google-maps-not-showing-on-venues-page/) |
|
You’ll need to get that /venues/ url issue sorted out. There’s a snippet you can add to your functions file that will make it so you can specify the /venues/ part of the url. Here’s a link to the documentation that includes the snippet: https://eventespresso.com/wiki/ee4-custom-post-types/#venue_slug After you put the code in place, you will need to visit your site’s WP > Settings > Permalinks page for the change to take effect. |
|
Done that. When the WP language is set to German or French, the /locations/ page still shows the venue photos but neither addresses nor maps nor course list per location. If I set the WP language is to US-English, all is revealed. |
|
Did you reset the permalinks after switching to another language? To be clear, are you switching the site language in WP > Settings > General or by some other means? |
|
Yes, I reset the permalinks after switching to another language and yes, I switch the site language in WP > Settings > General |
|
Can you try this code instead of the code from the documentation? https://gist.github.com/joshfeck/e1cd37a8ff1d37286c8ee36a73a82902 After you apply the code, you’ll need to visit WP > Settings > Permalinks. |
|
That works! Thanks a lot. |
|
I still have issues: |
|
You could hide those using CSS, or, the Read More link might be something your theme adds, you can check the archive.php template and wrap it in a condition or remove the code that adds it. The Details heading is in the content-espresso_venues-details.php template, and the location heading is in the content-espresso_venues-location.php template. You can copy those templates to your WordPress theme and make edits to the copies. Event Espresso will check first for your theme’s templates.
You can translate the string (or make it translation ready) in the custom code:
You go to edit the event and uncheck the box next to “Allow comments”. |
|
I’ve managed to suppress the DETAILS and LOCATION headings and the Read More link. And I’ve found the (hidden) “Allow comments” box and unchecked it. But I have no events_venue.php file. Where exactly should I add your snippet? |
|
You said earlier that you added the code to your functions.php file. Did you remove it? |
|
Sorry, I overlooked that. I’ve fixed the “UPCOMING EVENTS AT THIS VENUE” message. |
|
The support post ‘EE4 – List events by Venue’ 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.