Support

Home Forums Event Espresso Premium do_shortcode with ESPRESSO_EVNETS — Split From: Need Help! Crazyness going on….

do_shortcode with ESPRESSO_EVNETS — Split From: Need Help! Crazyness going on….

Posted: August 11, 2014 at 6:02 am

Viewing 9 reply threads


Jackie Blaker

August 11, 2014 at 6:02 am

if it helps, i’m getting the error when using

<?php echo do_shortcode("[ESPRESSO_EVENTS limit=1]"); ?>

in one of my templates.


Tony

  • Support Staff

August 11, 2014 at 6:29 am

Hi Jackie,

Looking at the link you provided earlier:

http://acs-tn.dev.maxx-design.co.uk/events/

Your event lists is now working. However I do notice your events are linking to /acs-events/ which does not work correctly. Changing the url back to /events/ works as expected.

Can I ask if you have recently altered anything since reporting this?

Looking deeper at this I suspect this is set up issue. Can you please provide some details into how you have your event lists set up?


Jackie Blaker

August 11, 2014 at 6:44 am

hmm thats pretty odd… it is now ignoring the changes in functions.php

Essentually i have added the following to functions.php in order to change the default events url.

add_filter( 'FHEE__EE_Register_CPTs__register_CPT__rewrite', 'acs_event_page_change', 10, 2 );
function acs_event_page_change( $slug, $post_type ) {
    if ( $post_type == 'espresso_events' ) {
        $custom_slug = array( 'slug' => 'acs-events' );
        return $custom_slug;
    }
    return $slug;
}

That in itself was working fine, i haven’t changed anything since, so was a little odd for it to revert the URL.. I’ve flushed out the permalinks and its back to what i would expect again.


Jackie Blaker

August 11, 2014 at 6:46 am

Update:: It reverted to showing the events because of a shared dev environment (multiple code bases, same DB). Another instance of the site updated the permalinks cache thus causing the events page to show up.

Issue remains im afraid 🙁


Tony

  • Support Staff

August 11, 2014 at 6:55 am

The /events/ page is basically and archive of the ‘espresso_events’ custom post type and not a ‘page’ in itself. So changing the slug for the events also alters the /events/ slug.

If you go here http://acs-tn.dev.maxx-design.co.uk/acs-events/ you’ll see the events working as expected.

So Event Espresso is actually working as expected for your use case, although this does highlight an issue when changing the slug. (The _Config issue reported)


Jackie Blaker

August 11, 2014 at 7:08 am

That still doesnt fix the issue… i need to be able to print out a list of 3 events on the /events/ page with that shortcode. The /events/ page (once the error is gone anyway) has a number of other items on it, and was inplace before installing espresso.

The slug was changed because espresso was basically hijacking a pre-existing page.

does that make sense?


Tony

  • Support Staff

August 11, 2014 at 7:39 am

Apologies, I didn’t intended to imply the issue was resolved.

That does make sense yes. We are investigating the Config error and will update as soon as we find the cause.


Josh

  • Support Staff

August 11, 2014 at 3:44 pm

Hi Jackie,

It turns out that Event Espresso 4.3 does not have support for using [ESPRESSO_EVENTS] with do_shortcode. It took some refactoring to make this happen, and the refactored code will be released with Event Espresso 4.4.

In the meantime if you want to display a list of events via a template, this can be accomplished with a custom loop like this:

https://gist.github.com/joshfeck/e3c9540cd4ccc734e755


Jackie Blaker

August 12, 2014 at 10:04 am

Hi Josh,

Sorry i missed the thread split there. That works for me 🙂 Thanks!


Josh

  • Support Staff

September 11, 2014 at 2:08 pm

Hi Jackie,

A little follow up: Event Espresso 4.4 is released and has the refactor that allows for the EE shortcode to work in a do_shortcode.

Viewing 9 reply threads

The support post ‘do_shortcode with ESPRESSO_EVNETS — Split From: Need Help! Crazyness going on….’ 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