Support » Plugin: WP-TopBar » Daily Show/Hide WP-Topbar

  • Hello,

    Is there a way to set Topbars to show and hide at the same time every day?

    I have 2 bars – 1 to show when the store is closed (open at…), then another when it’s open (call now…)

    Is this achievable?

Viewing 1 replies (of 1 total)
  • Plugin Author Bob


    Go to the “PHP” tab.

    Scroll to the bottom of the page.

    There is sample PHP code to use for the “CONTROL” code.

    Use this to only display this TopBar only between 7PM and 10PM, use this code:

    //$hour = date("H", current_time('timestamp', 1));     // use GMT time
    $hour = date("H", current_time('timestamp', 0));       // use local time
    if  ( ( ($hour >= 19) && ($hour < 22) ) )
    	$wptbControlExit = false;
    	$wptbControlExit = true;

    Then reverse the true/false statements for the second TopBar.

    Let me know if this works.


Viewing 1 replies (of 1 total)
  • The topic ‘Daily Show/Hide WP-Topbar’ is closed to new replies.