Support » Plugin: WP-TopBar » How to: Get WP Top Bar To Only Open Once

  • One of my favorite plug-ins. Is it possible to have the WP Top-Bar only open once no matter what page the user visits?

    I want the Top Bar to open no matter what page the user lands on. This is easy enough but I also do not want the Top Bar to reopen again on the next page. If the user clicks the close button it will not reopen but if the user does not click the close button, the top bar will keep opening again on every page.

    • This topic was modified 1 year, 4 months ago by  Pvanania.
Viewing 1 replies (of 1 total)
  • Plugin Author Bob

    (@rfgoetz)

    You can try creating custom PHP to do this.

    I have not tested this.

    On the Close Button Tab. Set the TopBar to
    Allow the TopBar to be closed: Yes
    Enable Cookies: Yes

    On the PHP tab… in the last text entry field (called “PHP Function to Control the TopBar…” ender this code.

    Be careful, adding incorrect PHP can break your website. Do this on a test site first.

    $wptb_cookie = "wptopbar_".$wptbOptions['bar_id'].'_'.COOKIEHASH;
    
    if (readCookie('".$wptb_cookie."') == ".'"'.$wptbOptions['cookie_value'].'"'.")
      $wptbControlExit = true
    • This reply was modified 1 year, 4 months ago by  Bob.
Viewing 1 replies (of 1 total)
  • The topic ‘How to: Get WP Top Bar To Only Open Once’ is closed to new replies.