Posted: March 24, 2014 at 5:59 pm
So, after abandoning Azure due to EE issue, I moved to Linux (dreamhost) to see if that fixed everything. The azure issues I had are no longer, but now I cannot get the event to display correctly with the Razor theme. All I see is the featured image, and the date/time. Any thoughts? |
|
Hi Donal, Was this the same theme that you were using before or is this a different one? Any links available so we can inspect the page with developer tools? — |
|
Lorenzo! Hey there. No I was using Mingle before (which seems to work better). TRy this link: http://inboston.dreamhosters.com/events/christmas-party/. I can setup an admin account for you also. |
|
If you view the source of that page you posted above, you will see a fatal error: Looks like your theme may be doing something strange to the global $post variable, therefore causing an endless loop. |
|
Thanks Seth. So how do I get this fixed when it’s an issue between plugin and theme? |
|
Hi Donal, We would need to know exactly what the theme is doing to the global $post variable to know how to fix. This is only a guess, but if the theme is messing up the main query you could try adding this to the theme’s functions.php file as a work around: function callback_that_does_nothing( $WP_Query ) { return $WP_Query; } add_action( 'pre_get_posts', 'callback_that_does_nothing', 8 ); |
|
Thanks Josh. The theme developer came back and suggested i up the memory using: |
|
Hi Donal, Increasing the available memory doesn’t fix the underlying issue, which is the theme isn’t written to WordPress coding standards. If we can take a look at the theme’s code and, if we can figure out what it’s doing, suggest workarounds. (We don’t have access to this theme, so you can send us a copy via our support@eventespresso.com email address.) |
|
Josh, i have just sent the them to the support address. |
|
Hi Donal, I loaded up the Razor theme on a test site and looked through its functions and it looks like the function that’s causing the issues you are seeing is the “the_content_filter” function. I can’t verify this exactly because I was seeing slightly different results when I tested it(the event details didn’t repeat over and over, but the page crashed where event details would normally be displayed). When I disabled the “the_content_filter” function the event content displayed on a page without getting hung up or crashing. Here’s a function that will disable “the_content_filter” for Event Espresso posts only that you can add to a custom snippet plugin add_action( 'template_redirect', 'remove_razors_content_filters' ); function remove_razors_content_filters() { global $post_type; if ( $post_type == 'espresso_events' ) { remove_filter( 'the_content', 'the_content_filter', 1 ); } } If the above works for you as well, it would be good to check with the theme developer and ask them what their “the_content_filter” is intended to do, and let them know that removing it fixes the issue. Maybe they can make some adjustments to it so it doesn’t need to be removed in order to display custom post content like events. |
|
Josh. THanks a million for this. I’m still trying to figure out WP/PHP etc. so will figure out how to do a custom snippet. How do I tell Event Espresso what page to use to display events? And is this the page I add the snippet to? thanks again. |
|
Hi Donal, Event Espresso uses example.com/events/ for the default event list page. If you would like to show events on a different page, then take a look at at some shortcode examples for [ESPRESSO_EVENTS] in WordPress admin –> Event Espresso –> Help & Support. The code that Josh shared should not be added to a WordPress page. Rather it should be added to a custom plugin. I’ve gone ahead and created one for you. Please take a look at this page to understand what a custom plugin is: http://ottopress.com/2011/creating-a-site-specific-snippets-plugin/ Then upload this file to your WordPress plugins folder (wp-content/plugins/): http://cl.ly/code/2k33350v0b1K — |
|
Lorenzo. Thanks very much. So i can change the events page that displays the list of events. But when you click on a single event, what is that page, and can it be changed? Thank you very much for the plugin. |
|
Single events will fall under the default /events/ page. Here is an example: mywebsite.com/events/my-new-event/ If you would like to change the slug from events to something else, then you can use something like this: add_filter( 'FHEE__EE_Register_CPTs__register_CPT__rewrite', 'my_custom_event_slug', 10, 2 ); function my_custom_event_slug( $slug, $post_type ) { if ( $post_type == 'espresso_events' ) { $custom_slug = array( 'slug' => 'workshops' ); return $custom_slug; } return $slug; } The function above changes it from events to workshops. You can copy and paste the example above into the plugin file that I shared earlier. Then change the word workshops to something else. — |
|
Thanks Lorenzo. I get single events fall under /events. So does that mean a single event uses the same layout as the events page? For example, I can change the layout for the events page, but i cannot change the layout for an event in EE. Also, under appearance->layouts, I can select the layout for the custom post type “Events”. What does this do? |
|
The events list page and single events page are “virtual.” Then aren’t pages in WP-admin –> Pages. See this article for options on customizing the Event Espresso 4: https://eventespresso.com/2014/02/developers-corner-theming-event-espresso-4/ — |
|
The support post ‘Event not displaying right with Razor theme’ 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.