Support

Home Forums Event Espresso Premium Single event / registration page using different template than events list page?

Single event / registration page using different template than events list page?

Posted: April 3, 2014 at 10:21 am

Viewing 5 reply threads


Remco Kalf

April 3, 2014 at 10:21 am

Is it possible to have the single event / registration page have a different layout than the event listing page?

When I use the [ESPRESSO_EVENTS] shortcode, the list and the single event use the same wordpres template, causing the same title and intro text above the page.

What I would like is that the single event page uses a different template. I would like to have it look different and have different intro text on top.

Is that possible, and how?

If yes, my next questions are:
– can the page title of the single event page be the event title?
– is it possible to have pretty permalinks on single event pages?

I know using the custom-post-type option would solve above questions. I tried this,but took it out again, because with the provided custom post type templates, I seem to lose a lot of functionality (like timeslots) that I need…

I hope you can point me in the right directions, I have been wrestling with this all day.


Lorenzo Orlando Caum

  • Support Staff

April 3, 2014 at 10:32 am

Hello,

The shortcodes that are shown in WP-admin –> Event Espresso –> General Settings –> Page Settings are needed for Event Espresso to work correctly.

You may be interested in the Event List shortcode: https://eventespresso.com/wiki/shortcodes-template-variables/#event-list

Note: it does not replace the [ESPRESSO_EVENTS] shortcode which is needed for Event Espresso to work correctly.

Pretty permalinks are not available for single event pages.

Try the Event List shortcode and then we can take a look at your other questions. It would also be helpful to see your events page.


Lorenzo


Remco Kalf

April 3, 2014 at 2:49 pm

Thanks. I got it. I can use a page with [EVENT_LIST] for the listpage, and a page with [ESPRESSO_EVENTS] for the single events (and make it use a different wordpress template). Somewhat confusing but it works.

I even found this plugin mentioned in the forums to adapt the title tag with the event name in the single event page:
https://gist.github.com/joshfeck/7832044

I have one question left:
I would like to change the page title of the single events page to the events name (now it’s the same for all events: the page title I give to the page with the [ESPRESSO_EVENTS] shorttag).
I can’t get add_filter( ‘wp_title’…) to work. Do you have any suggestions or a similar plugin as the one mentioned for the title tag?

Not really relevant anymore, but here are my test pages:

List:
http://www.talentwerkt.nl/agenda/aanmelden-events-test/
Single:
http://www.talentwerkt.nl/agenda/aanmelden-events/?ee=2


Dean

April 4, 2014 at 4:12 am

Hi,

I think you may be mistaking wp_title for the_title. wp_title will change the title tag in the HTML whereas the_title will change the actual page or post title.

That being said, I cannot see a way to achieve this. The page is loaded before the event data as the event data is added dynamically.

This means that there isn’t a way that I can see to get the right information in time to filter the page title.

EE4 helps resolve this problem by using true custom post types for the events, so each even is its own unique post.

https://codex.wordpress.org/Plugin_API/Filter_Reference/the_title


Remco Kalf

April 4, 2014 at 5:55 am

Sorry, I meant the_title, you are right.
It works for wp_title (with the mentioned plugin), so I was hoping it would work for the the_title. My knowledge of WordPress inner working is not well enough to understand this difference.

So I guess I am out of luck.
EE4 looks promising, but not for this project.
Thanks!


Remco Kalf

April 4, 2014 at 6:13 am

After some tinkering, I finally managed to do it:
http://www.talentwerkt.nl/agenda/aanmelden-events/?ee=2

My page title is now the event title. Same as title tag.
I used the code from the mentioned plugin, and added a filter to ‘single_post_title’.
I put the code in functions.php.

function ee_reg_page_ptitle( $etitle ) {

if ( function_exists('espresso_get_event') ) {
global $this_event_id;

if (isset($this_event_id) && !empty($this_event_id)){
$event_id = $this_event_id;
}

if ( empty( $event_id ) ) return $etitle ;

$event = espresso_get_event( $event_id );

if ( empty( $event ) ) return $etitle;

if ( $event_id ) {
$event = espresso_get_event( $event_id );

$etitle = '';

$etitle= "$event->event_name ";

return $etitle;

}
}
}

add_filter( 'single_post_title', 'ee_reg_page_ptitle', 20, 1 );

Viewing 5 reply threads

The support post ‘Single event / registration page using different template than events list page?’ 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