WordPress.org

Support

Support » Plugins and Hacks » timed widget

timed widget

Viewing 6 replies - 1 through 6 (of 6 total)
  • i cant get it to work. is somewhere samples ho to use this plugin?

    Plugin Author alanft

    @alanft

    try changing the first bit to
    $hour = 0+date_i18n(‘G’)

    which makes $hour an integer instead of a string so that the second bit works reliably. the other thing to check is to print out date_i18n(‘G’) somewhere (via a PHP widget would work) so you can check what your server thinks is the local time.

    thanx, but i dont understand nothing from WP’s Conditional Tags – i’m total noob and found this code somewhere in wp forum. I try to use this in adrotate widget to show some ads only in nights, but i cant get it to work.
    So now i tried:
    $hour = 0+date_i18n(‘G’); if ($hour < 22 || $hour > 7 ) return true;

    but it wont work for me…

    Plugin Author alanft

    @alanft

    it should definitely be && (that is ‘AND’) and not || (which is ‘OR’) to work. But if it’s not working then perhaps date_i18n isn’t working as expected on your install, and you’ll have to work out some way of checking what it is doing.

    i made echo date_i18n(‘G’); and server time is correct. i tried to use logic in adrotate widget.. maybe adrotate wont work?

    i give up, server time is correct…
    code in wiget is correct as:
    $hour = 0+date_i18n(‘G’); if ($hour > 22 && $hour < 7 ) return true;

    and its not working

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘timed widget’ is closed to new replies.