Support

Home Forums Event Espresso Premium Custom [php] code

Custom [php] code

Posted: September 9, 2015 at 6:13 am

Viewing 3 reply threads


Legrind

September 9, 2015 at 6:13 am

I would like to use custom php code to show the events for the current month like:
[ESPRESSO_EVENTS_TABLE_TEMPLATE month=”[php snippet-month]”]

How can I achieve this? When I add it as above the line will break on the bracket.


Josh

  • Support Staff

September 9, 2015 at 3:22 pm

Hi there Legrind,

There’s a WordPress codex article that suggests one way to handle this sort of thing is make a new shortcode that returns the original shortcode with the do_shortcode function.

http://codex.wordpress.org/Shortcode_API#Nested_Shortcodes

Below in the link you’ll find an example that shows how to make a new shortcode that loads in your custom PHP code and the original shortcode. To use this example, you place the code in a functions file on your site (either in a theme’s functions.php file or in a separate plugin), then you add the new [this_month_event_table] to a page.

https://gist.github.com/joshfeck/90886135af668c780189


Legrind

September 22, 2015 at 10:44 am

Hi Josh,

Thanks, this is what i was looking for.


Josh

  • Support Staff

September 22, 2015 at 11:22 am

You are welcome.

Viewing 3 reply threads

The support post ‘Custom [php] code’ 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