Support

Home Forums Event Espresso Premium EE4 People Addon: how to move PERSON to end of single content

EE4 People Addon: how to move PERSON to end of single content

Posted: April 8, 2015 at 12:01 pm


Brandon Gannon

April 8, 2015 at 12:01 pm

I like the People addon. But it adds our instructor at the TOP of the content. I’d like it at the bottom. Is there a way to do this? THANKS!


Lorenzo Orlando Caum

  • Support Staff

April 8, 2015 at 1:08 pm

Hi Brandon, it should appear at the end by default. Are you using a code snippet that has adjusted the order of the elements on the single event page?


Lorenzo


Brandon Gannon

April 8, 2015 at 1:22 pm

No, I don’t think so. Site is in development, not public yet. Here’s an example:

redacted – Event Espresso support team – LOC


Lorenzo Orlando Caum

  • Support Staff

April 8, 2015 at 2:04 pm

Thanks, would it help if the event description was relocated above the ticket selector?


Lorenzo


Brandon Gannon

April 8, 2015 at 2:48 pm

Hi Lorenzo. Yes, essentially we have four “blocks” that ideally we’d like to position as we see fit: Ticket, Dates/Times, People and Content/Description. Does EE4 allow us to position these as needed and if so, how do we do that?

Brandon


Lorenzo Orlando Caum

  • Support Staff

April 8, 2015 at 3:38 pm

Sure, could you try this sample coding:

https://gist.github.com/lorenzocaum/a33405557a2a065779ea

It can be added to your child theme’s functions.php file (do not include the opening php tag) or a site specific plugin:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/


Lorenzo


Brandon Gannon

April 8, 2015 at 5:35 pm

This is a great help, thanks!
I’m almost all the way there. Forgive me, I’m fuzzy on how all this works.
I’m now able to move my blocks around almost at will.
EXCEPT: the people/instructor block won’t disappear. I can add it at the bottom but not delete it from the top. I’m guessing the problem is in this line:

remove_filter( 'the_content', array( 'EED_Event_Single', 'people_event_details' ), 101 );

I’m guessing that EED_Event_Single is wrong. What should be there?

THANKS!


Dean

April 9, 2015 at 3:28 am

Hi,

I’m wondering if there is a conflict of some sort here. The thing is, if you had not modified the plugins code prior to installing the People addon, the people content should appear below the datetimes, not at the top.

Now that you have added some code to move things around, it looks even clearer that there is something else at play here as the People content is remaining at the top.

Can you try using a plugin called Theme Test Drive, to temporarily swap to another theme such as a default one like Twentytwelve or Twentyfifteen to see if that removes the top People content?

If that makes no difference, can you temporarily deactivate all plugins except EE and EE People to see if that changes the layout?


Brandon Gannon

April 9, 2015 at 11:43 am

Good points and yes, I wonder if there’s a conflict.
(By the way: I’m actually the web designer: Jim. Brandon is the owner of the license and I’m using his login with his permission of course.)
I do LOOK inside plugins but know to not change anything there.

I’ve tried:
Theme Test Drive, switch to Twentyfifteen. Same thing: Instructor above content. (But my functions.php work was of course gone so all the other items were back in their usual places.)
And turned off all plugins except EE. Same thing, no change.
Also, I updated EE this morning, before trying all this.

We are using a theme from Themeforest called University. We’re changing it radically. It came with its own Events plugin, which turned out to be useless. But we like the look, so we’re modifying.

And by the way: THANKS! I really appreciate the help.
Jim


Lorenzo Orlando Caum

  • Support Staff

April 9, 2015 at 12:51 pm

Hi Jim,

Did you add the filter that I shared and what does it currently look like?


Lorenzo


Brandon Gannon

April 9, 2015 at 1:02 pm

Yes. I’ll paste below.
To be honest, I’m not very conversant on hooks and filters and such.

And here’s a link to show what it looks like (though it’s in a development site, so I’d appreciate if you’d redact it as you did before):

redacted – Event Espresso support team – LOC


// WHAT FOLLOWS IS EVENT ESPRESSO CODE TO MOVE BLOCKS AROUND PAGE

add_filter ('the_content', 'my_remove_event_datetimes', 100 );
 
// remove datetimes
function my_remove_event_datetimes( $content ) {
    if ( 'espresso_events' == get_post_type() && is_singular() && !post_password_required() ) {
        remove_filter( 'the_content', array( 'EED_Event_Single', 'event_datetimes' ), 110 );
        add_filter( 'the_content', 'my_add_event_datetimes', 121);
    }
    return $content;
}
 
// add datetimes after the tickets
function my_add_event_datetimes( $content ) {
    return $content . EEH_Template::locate_template( 'content-espresso_events-datetimes.php' );
}

add_filter ('the_content', 'my_remove_event_tickets', 100 );
 
// remove tickets
function my_remove_event_tickets( $content ) {
    if ( 'espresso_events' == get_post_type() && is_singular() && !post_password_required() ) {
        remove_filter( 'the_content', array( 'EED_Event_Single', 'event_tickets' ), 120 );
        add_filter( 'the_content', 'my_add_event_tickets', 160);
    }
    return $content;
}
 
// add tickets after the content
function my_add_event_tickets( $content ) {
    return $content . EEH_Template::locate_template( 'content-espresso_events-tickets.php' );
}

add_filter ('the_content', 'my_remove_event_people', 100 );

// remove INSTRUCTOR
function my_remove_event_people( $content ) {
    if ( 'espresso_events' == get_post_type() && is_singular() && !post_password_required() ) {
        remove_filter( 'the_content', array( 'EED_Event_Single', 'people_event_details' ), 101 );
        add_filter( 'the_content', 'my_add_people_details', 150);
    }
    return $content;
}

// add INSTRUCTOR after the content
function my_add_people_details( $content ) {
    return $content . EEH_Template::locate_template( 'content-espresso_events-people.php' );
}

// remove VENUE
function my_remove_event_venue( $content ) {
    if ( 'espresso_events' == get_post_type() && is_singular() && !post_password_required() ) {
        remove_filter( 'the_content', array( 'EED_Event_Single', 'event_location' ), 120 );
        add_filter( 'the_content', 'my_add_event_venue', 102);
    }
    return $content;
}
 
// add VENUE after the content
function my_add_event_venue( $content ) {
    return $content . EEH_Template::locate_template( 'content-espresso_venues-location.php' );
}


Josh

  • Support Staff

April 9, 2015 at 2:42 pm

Hi Jim,

It turns out the People add-on uses a different hook and the priority of 101 is too late. This is because the People add-on adds to the_content filter at a priority of 90. When you remove a filter in WordPress, it needs to match the priority of when it was added.

Can you try this instead?

remove_filter( 'the_content', array( 'EE_People_Template_Hooks', 'people_event_details' ), 90 );


Brandon Gannon

April 9, 2015 at 2:49 pm

Aha, makes sense. And yes, that fixed it.
THANKS!


Lorenzo Orlando Caum

  • Support Staff

November 18, 2015 at 8:47 am

Hello again Brandon,

As of Event Espresso 4.8.21, there is a custom display re-order option available in the WordPress dashboard.

Backup your WordPress and update your software

https://eventespresso.com/wiki/how-to-back-up-your-site/

You can see the change log for Event Espresso 4 here:

https://eventespresso.com/wiki/ee4-changelog/

Remove existing filters for adjusting the order

If you have used some of the suggested filters to adjust the order of your event elements, then you’ll want to first remove those from your website and they may have been added to your child theme’s functions.php file or a site specific plugin.

Set a custom order through the Templates screen

Afterwards, go to your WP dashboard (WP-admin) –> Event Espresso –> Events –> Templates. The Use Custom Display Order options in the Templates screen can be used to reorder the events elements on the single event page as well as the events listing page.

Again, be sure that any of the filters for adjusting the order have been removed from your site specific plugin or your child theme’s functions.php file before turning on the template reorder option. Otherwise, you may see duplicate content.

Thanks


Lorenzo

The support post ‘EE4 People Addon: how to move PERSON to end of single content’ 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