Support

Home Forums Event Espresso Premium Passing Category Slug as variable

Passing Category Slug as variable

Posted: January 31, 2015 at 12:22 am

Viewing 1 reply thread


BMuse Studio

January 31, 2015 at 12:22 am

Hi, do you have any examples or ideas how you could pass the category slug via the url to be used in an EE shortcode? For example, I have a sidebar with category/venue links that go to a page with this shortcode on it [ESPRESSO_EVENTS category_slug=”classes”]. What I’d like to accomplish is passing the category to it for example http://www.mydomain.com/filter?cat=classes. So that shortcode would be something like [ESPRESSO_EVENTS category_slug=”$_GET[‘CAT’]”]. Then I only have to have one page for listing 15+ categories and venues based on the customer choosing one of the filters.

Or is there an easier way to create a list of categories/venues with hyperlinks that go to a page that lists the categories/venues? When I use the built in page it shows them as blogs style entries, I’m wanting the list style view like so http://www.api-curious.com/classes-events/

Thanks


Dean

February 2, 2015 at 1:35 am

Hi,

The only way I can think of doing it would be to write a page template file or a separate custom shortcode that would use do_shortcode, and then grab the category from the $_GET global.

http://codex.wordpress.org/Function_Reference/do_shortcode

Viewing 1 reply thread

The support post ‘Passing Category Slug as variable’ 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