Support

Home Forums Event Espresso Premium Alphabetical Order for Accordion Categories

Alphabetical Order for Accordion Categories

Posted: November 24, 2014 at 4:06 am

Viewing 5 reply threads


victorsfood

November 24, 2014 at 4:06 am

Hi is there any way to get the Accordion categories in alphabetical order?

Currently using this code:

[EVENT_CUSTOM_VIEW template_name=”category-accordion” show_expired=false]


Dean

November 24, 2014 at 5:10 am

Hi,

It can be done but would require an edit to the template file directly.

In the /wp-content/plugins/espresso-template-category-accordion/index.php file it says:

$sql = "SELECT * FROM " . EVENTS_CATEGORY_TABLE;

on line 52.

change it to

$sql = "SELECT * FROM " . EVENTS_CATEGORY_TABLE . " ORDER BY category_name ASC";

Please note, updates to the add on will over write any changes made.


victorsfood

December 1, 2014 at 3:15 am

Thanks Dean. It worked, but after I did it the accordion seems to be stuck in a permanently expanded state for each category. Is there anyway to fix this?

THanks.


victorsfood

December 1, 2014 at 3:20 am

Also, is the category accordion supposed to obey the ‘read more’ tags for events? I am currently getting all paragraphs for the event showing in the accordion rather than just the intro line.


Sidney Harrell

December 3, 2014 at 1:04 pm

Sounds like something broke. I just tested Dean’s modification and the more tag, and both look like they are working. Can you revert your modifications and try to apply them again? Did you change anything else in that index.php file?


victorsfood

December 5, 2014 at 2:00 am

Hi Sidney I just downloaded the latest version of the module from your website and updated the index.php on that. Seems to have fixed the problem! I did note when I edited my original version that line of code was on line 42 not line 52. So must have been an outdated version. Thanks.

Viewing 5 reply threads

The support post ‘Alphabetical Order for Accordion Categories’ 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