WordPress.org

Ready to get started?Download WordPress

Forums

Event Registration
[resolved] Event Listing Sidebar Widget Listing Question (3 posts)

  1. mars1
    Member
    Posted 3 years ago #

    Hello all,

    I love this plugin and I have one question.

    For event listing sidebar widget, could we set it like only show 5 events?

    Since I add total 36 events for a whole month, I only want it to list most 5 current events based on the day of today.

    Is it possible? Please help.
    Thank you so much for your time.

    http://wordpress.org/extend/plugins/event-registration/

  2. avdude
    Member
    Plugin Author

    Posted 3 years ago #

    While I am not an expert and have not tried this, in the file er_wideget. Look at line 32:
    $sql = "SELECT * FROM " . get_option('events_detail_tbl') ." WHERE str_to_date(start_date, '%Y-%m-%e') >= curdate() ORDER BY str_to_date(start_date, '%Y-%m-%e')";

    Change to $sql = "SELECT * FROM " . get_option('events_detail_tbl') ." WHERE str_to_date(start_date, '%Y-%m-%e') >= curdate() ORDER BY str_to_date(start_date, '%Y-%m-%e') LIMIT 5";

    I think that will do it, or at least set you on the right path.

    Sorry but busy with other issues to test myself.

  3. mars1
    Member
    Posted 3 years ago #

    Hello,

    Thanks a lot. It is working great now.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic