Support » Plugin: St-Daily-Tip » Loop by weekdays, overwrited by specific date?

  • Resolved andersha

    (@andersha)


    Hi,

    My client is only occasionally changing the tip of the day, therefore I made a loop by weekdays, showing a monday tip, tuesday tip and so on.

    Is it possible to overwrite a weekday tip from my week loop, by a specific date tip?

    Can I changes the priority? Or how can I make this work?

    Best Anders

    https://wordpress.org/plugins/st-daily-tip/

Viewing 2 replies - 1 through 2 (of 2 total)
  • I looked into, the st-daily-tip.php and on line 91. I changed:

    $tips = $wpdb->get_row("SELECT * FROM $table_name WHERE (DATE(Display_Date)=DATE('$todate') OR DATE(Shown_Date)=DATE('$todate')) AND group_name='$group';", ARRAY_A);

    into

    $tips = $wpdb->get_row("SELECT * FROM $table_name WHERE (DATE(Display_Date)=DATE('$todate')) AND group_name='$group';", ARRAY_A);

    And things works perfectly now, I have a loop by weekdays and whenever a todays date matches a tip date it overwrites the loop.

    Plugin Author Dhara Shah

    (@dharashah)

    Hi andersha,

    Actually we have kept the logic to override day by date.
    It is simple, if you want the tips to display on a particular weekday, don’t mention the date.

    I am not sure how the change you have made should work.
    Actually the shown_date is the Last Shown Date as displayed in the Tips List.
    This is (DATE(Shown_Date)=DATE(‘$todate’)) logic is kept so that once a tip is selected for a day, it doesn’t get changed later.

    Let me know if you are still facing the problem.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Loop by weekdays, overwrited by specific date?’ is closed to new replies.