• Resolved ~MR

    (@mediblereview)


    Hello, I am using a custom events page showing data in a simple table format. The past events are all sorted in ascending order, and I would like to reverse them. Does anyone know how to do this? This is the code I am using to display

    <td>
    #_{m/d/Y} #@_{- m/d/Y}<br/>
    #H:#i -#@H:#@i
    </td>

    Even better, is there an easy way for the user to sort the events by date ascending or descending?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    The best way to do this would be to use the [events_list] shortcode with the order and orderby attributes:

    https://wp-events-plugin.com/documentation/shortcodes/

    Thread Starter ~MR

    (@mediblereview)

    My original shortcode was:

    [events_list category="32"]

    I tried changing to:

    [events_list orderby="event_start_date"?order="DESC" category="32"]

    Nothing changed. Am I on the wrong track? I just want the search results of events to be listed in descending order.

    Here is the link: https://www.vwacolorado.net/connect/events/

    Here is the formatting code I am using for the events page under the formatting section:

    Default event list format header

    <table cellpadding="5" cellspacing="0" width="95%" id="current-events" >
        <thead>
            <tr>
                <th id="event-name" width="40%"> Name</th>
                <th id="event-location" width="50%">Location</th>
    	    <th id="event-time" width="10%">Date and Time</th>
    	    </tr>
        </thead>
        <tbody>

    Default event list format

       <tr>
                <td>
                  
    	    <strong><a href="#_EVENTPAGEURL" style="text-decoration:underline;">
                           #_EVENTNAME
        	    </a></strong>
    
                </td>
    
                <td>
     		#_LOCATIONNAME
                    -- #_CATEGORYNAME
    	    </td>
    
    	    <td>
     		<strong>#_{m/d/Y} #@_{- m/d/Y}<br/></strong>
                    #H:#i -#@H:#@i
    	    </td>
    
       </tr>

    Default event list format footer

    </tbody>
    </table>
    Plugin Support angelo_nwl

    (@angelo_nwl)

    did you try something like

    [events_list scope=”past” orderby=”event_start_date” order=”DESC” category=”32″]

    Thread Starter ~MR

    (@mediblereview)

    Never mind, I just figured it out. Thanks for your help though.

    The setting is under the Event List Archives section -> Default event list options -> Default event list ordering. I must have missed it the first 10 times.

    • This reply was modified 6 years, 6 months ago by ~MR.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘List events in descending order by date’ is closed to new replies.