• Resolved adrockmk2

    (@adrockmk2)


    I can’t seem to get the plugin to order the events by date, which I think is the default? They are listing in alphabetical order, and since the event posts “title” is the date itself the list isn’t showing January events, just skipping December events to February events…

    Any idea why this is happening?

    On the “test” URL https://ivcf.ca/test/ I have this shortcode: [ecs-list-events orderby='enddate']

    And on the main events list page https://ivcf.ca/prayer-list/ I’ve tried other options: [ecs-list-events key="start date" orderby="start date"?eventdetails="false" excerpt="true" order="DESC"] but nothing seems to effect the order.

    Any help would be great, thanks!

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Brian Hogg

    (@brianhogg)

    Hi @adrockmk2!

    Strange, I’m not seeing any titles of events on that page, did you add some custom code to change the display? You’re right the ordering is certainly by date (order by title isn’t even an option).

    Another plugin or your theme might be affecting the output, which you can check with the following steps:

    ?You can determine which plugin or theme is causing the issue with the following steps:

    1. Ensure you have a backup of your site in case there are any issues when disabling/enabling plugins or your theme
    2. Disable all plugins (except your calendar plugin and this plugin), and switch to a default theme like Twenty Sixteen then verify the issue is resolved
    3. Re-enable your plugins and switch back to your previous theme one by one verifying if the issue is still occurring, and note which one causes it to break

    Let me know which plugin/theme causes the issue and I may be able to come up with a fix, but you’ll also need to contact the theme or plugin author and have them fix the issue, or remove any custom code you might have added (ie. in your theme’s functions.php).

    Thanks!

    Thread Starter adrockmk2

    (@adrockmk2)

    Hey Brian, thanks for the quick reply!

    What you are seeing in the list is the post title …just the date typed out, no special code.
    https://adamepp.com/drop/Prayer_List_1FED5B0A.png

    I’ll take a look at the steps you mentioned and let you know. The theme is called Montserrat, I believe it’s from Themeforest.

    • This reply was modified 6 years, 10 months ago by adrockmk2.
    Thread Starter adrockmk2

    (@adrockmk2)

    @brianhogg I figured it out…turns out it was some custom functions in the theme, completely unrelated to the events post type. We have a custom post type of “people” and somehow the custom sorting of that was overriding the events, too.

    I’ll figure it out, but thanks again for your help.

    Plugin Author Brian Hogg

    (@brianhogg)

    No problem! Glad you were able to find out where the change to the sorting was happening, and can avoid changing it for events.

    I want to order my events alphabetically. Is that possible?

    Thanks,
    Julie

    Plugin Author Brian Hogg

    (@brianhogg)

    Hi @juliea8!

    Currently not, just by start or end date which can be overridden with the orderby option.

    You can try something like this in a functional plugin or your child theme’s functions.php:

    
    function ecs_order_by_title( $args ) {
        $args['orderby'] = 'title';
        return $args;
    }
    add_filter( 'ecs_get_events_args', 'ecs_order_by_title', 1000, 1 );
    

    Worked great! Thanks so much

    Hi, is there any way of modifying this to use a custom order? Perhaps with metabox for each event?

    function ecs_order_by_title( $args ) {
    $args[‘meta_key’] = ‘customorder’;
    $args[‘orderby’] = ‘meta_value_num’;
    $args[‘order’] = ‘desc’;
    return $args;
    }
    add_filter( ‘ecs_get_events_args’, ‘ecs_order_by_title’, 1000, 1 );`

    I’ve tried something like that but no events show when I use that. Any ideas?
    Thank you.

    Plugin Author Brian Hogg

    (@brianhogg)

    Hi @drinkingsouls,

    It’s a little tricky as meta_key is used in filtering the results by date, so trying to order by a custom value like that won’t work. You could potentially use the ecs_filter_events_after_get filter to re-order the array of events you get by your custom value instead.

    Hope that helps!

    Thank you for your reply.
    In what way would I use this to order? Are there any code references on how to use this?
    Thank you.

    Plugin Author Brian Hogg

    (@brianhogg)

    Hi @drinkingsouls,

    That filter gives you an array of the post objects (events), so you could re-order that array and then return it. I don’t have any code examples for your specific case unfortunately. There might be another way to customize with ecs_get_events_args to get the ordering to work, depending on what parameters you’ll be using.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Orderby not working, stuck in alphabetical’ is closed to new replies.