WordPress.org

Ready to get started?Download WordPress

Forums

WP Calendar
[resolved] Order Direction "orderdir" not working. (8 posts)

  1. heavymark
    Member
    Posted 3 years ago #

    In my events template I have the following code:

    <?php fse_print_events(
      array( 'number'   => 100,
              'categories' => 14,
             'before'   => '<table cellpadding="0" cellspacing="0">',
             'after'    => '</table>',
             'datefrom'   => mktime(0,0,0,1,1,2009),
             'orderdir' => 'DESC',
             'template' => '<ul><li><strong>Title</strong><a href="{event_url}">{event_startdate} {event_subject}</a></li><li><strong>Documents</strong>{event_description}</li></ul>'
      )
    ); ?>

    The problem is the oldest events always appear on top rather than the newest which makes more sense. I've tried orderdir 'DESC' and 'ASC' neither make a difference.

    What do I need to add or change to the code above to change the order the events are outputted in? Thank you!

  2. heavymark
    Member
    Posted 3 years ago #

    Just checking in. Anyone have any ideas? (mainly the developer =)

    Thanks!

  3. heavymark
    Member
    Posted 2 years ago #

    Has anyone been able to get a hold for the plugins developer?

    Been two weeks and still no response, just need to know if there is a quick fix, or if the plugin does not support ordering (though according to docs it looks like it does).

    I've tried tweeting and contacting him through social media sites but no luck. If anyone know's how to reach him please let me know. Thanks so much.

  4. kasia_codeword
    Member
    Posted 2 years ago #

    I'm having the same problem. orderdir does not work. Anyone figured out how to fix this yet?

  5. heavymark
    Member
    Posted 2 years ago #

    Unfortunately, don't expect a response from this developer. I had made the error of hoping I would hear back, but waited weeks and nothing.

    I resolved the problem through a hack. That is I had jquery reorder the list after it was rendered. It's unfortunate that the developer does not have more care for his work to respond as the documentation seems to suggest the functionality exists but just does not say how. I tried facebooking and twittering him but nothing.

    Best of luck at hearing back otherwise I suggest a hack as: http://lab.arc90.com/tools/jquery_reverseorder/

  6. kasia_codeword
    Member
    Posted 2 years ago #

    Would you be willing to share the hack as it is implemented in your code with me?

  7. faebu
    Member
    Plugin Author

    Posted 2 years ago #

    i just checked it in debug mode an i figured out, that you cannot only define the sort direction without passing the column to be sorted by. to solve the order issue, passing the column name should do it:

    <?php fse_print_events(
      array( 'number'   => 100,
              'categories' => 14,
             'before'   => '<table cellpadding="0" cellspacing="0">',
             'after'    => '</table>',
             'datefrom'   => mktime(0,0,0,1,1,2009),
             'orderby'  => 'tsfrom',
             'orderdir' => 'DESC',
             'template' => '<ul><li><strong>Title</strong><a href="{event_url}">{event_startdate} {event_subject}</a></li><li><strong>Documents</strong>{event_description}</li></ul>'
      )
    ); ?>
  8. kasia_codeword
    Member
    Posted 2 years ago #

    Thank you so much for this, faebu. The documentation for the plugin says that the 'orderby' should be set to 'datefrom' or 'dateto', no idea where 'tsfrom' came from, but you rock for figuring this out.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic