WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Order Direction "orderdir" not working.

[Resolved] Order Direction "orderdir" not working.

  • heavymark
    Member

    @heavymark

    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!

Viewing 7 replies - 1 through 7 (of 7 total)
  • heavymark
    Member

    @heavymark

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

    Thanks!

    heavymark
    Member

    @heavymark

    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.

    Kasia
    Member

    @kasia_codeword

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

    heavymark
    Member

    @heavymark

    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/

    Kasia
    Member

    @kasia_codeword

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

    Plugin Author faebu
    Member

    @faebu

    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>'
      )
    ); ?>
    Kasia
    Member

    @kasia_codeword

    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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] Order Direction "orderdir" not working.’ is closed to new replies.