• Hello its me again, I am now trying to implement using the hours feature to have an “open/close” sign. You’ve tought me here how to do it but just a couple of questions. How do I extract the hours using this. Because for example, a restaurant has a schedule on Monday from 11:00 to 14:00 and 17:00 to 23:00. How do I get the individual hours of each day to compare it with the current time? Thank you very much for all the help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter itsfrancisnadal

    (@itsfrancisnadal)

    hi, would really appreciate any reply.

    Plugin Author Tijmen Smit

    (@tijmensmit)

    You can grab the hours ( without a table wrapped around them ) with this code.

    $hours = get_post_meta( $store_meta['id'], 'wpsl_hours', true );

    This will give you the current AM / PM time.

    echo date('h:i A', time() );

    Use explode to split the hours for a day, and check if the current time is between or after the opening / end time.

    • This reply was modified 6 years, 5 months ago by Tijmen Smit.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Extract the hours’ is closed to new replies.