Support

Home Forums Event Espresso Premium Event not displaying right with Razor theme

Event not displaying right with Razor theme

Posted: March 24, 2014 at 5:59 pm


Donal

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?


Lorenzo Orlando Caum

  • Support Staff

March 24, 2014 at 6:09 pm

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


Donal

March 24, 2014 at 6:18 pm

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.


Seth Shoultes

  • Support Staff

March 25, 2014 at 12:23 am

If you view the source of that page you posted above, you will see a fatal error:
<b>Fatal error</b>: Allowed memory size of 94371840 bytes exhausted (tried to allocate 30720 bytes) in <b>/home/doncon5/inboston.dreamhosters.com/wp-content/plugins/event-espresso-core-reg/templates/Espresso_Arabica_2014/content-espresso_events-details.php</b> on line <b>22</b>

Looks like your theme may be doing something strange to the global $post variable, therefore causing an endless loop.


Donal

March 25, 2014 at 7:37 am

Thanks Seth. So how do I get this fixed when it’s an issue between plugin and theme?


Josh

  • Support Staff

March 25, 2014 at 9:35 am

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 );


Donal

March 25, 2014 at 12:03 pm

Thanks Josh. The theme developer came back and suggested i up the memory using:
define(‘WP_MEMORY_LIMIT’, ’64M’);
I did that and now i see that “event Details” is continuously repeated until the page blows up. So looks like this is causing the memory issue. Not sure what’s next to get this fixed. EE looks fine on 2014 theme, but Mingle has issues (not showing image, formatting off, but not blowing up mem); and Razor is blowing up in a big way.
I’m new to WP, so not sure how all this works.


Josh

  • Support Staff

March 25, 2014 at 6:57 pm

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.)


Donal

March 28, 2014 at 8:12 am

Josh, i have just sent the them to the support address.


Josh

  • Support Staff

March 29, 2014 at 3:21 pm

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.


Donal

March 29, 2014 at 5:07 pm

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.


Lorenzo Orlando Caum

  • Support Staff

March 29, 2014 at 7:05 pm

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


Donal

March 29, 2014 at 7:52 pm

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.


Lorenzo Orlando Caum

  • Support Staff

March 29, 2014 at 7:59 pm

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.


Lorenzo


Donal

March 29, 2014 at 8:09 pm

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?


Lorenzo Orlando Caum

  • Support Staff

March 30, 2014 at 10:31 am

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/


Lorenzo

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.

Event Espresso