• Resolved joeistoybox

    (@joeistoybox)


    Hi there, love the plugin. I had to make a few modifications to get it to work right. The notice didn’t display two lines worth of text because the height of the div was set to 50px so it could never grow taller. This effects both desktop and mobile, only the mobile is more likely to force two or more lines of text.

    First, I added the custom css: .swn_banner{ min-height:50px; height:auto;} This allows the notice to stretch higher to fit 2 lines or more.

    Second, the close button image did not display when going more than one page deep in my site. It needs the background url to have the whole site address. example:
    .closeButton{background:url(‘https://example.com/wp-content/plugins/sitewide-notice-wp/images/close-button.png’) no-repeat center center;} Actually, if someone smarter than me could code the wordpress magic that would replace the https://example.com/ it would be even better.

    These modifications make the plugin work great on my desktop and mobile.

    Finally, I had the plugin enable/disable button stretching all the way down the page in the admin panel like someone else mentioned before. So I added the following code to the end of the bootstrap-switch.min.css file:
    .bootstrap-switch{height:30px !important;}
    .bootstrap-switch-container{height: 30px !important;}
    I believe this was already mentioned, but 30px works better for me than the 50px someone mentioned.
    And I increased the input box size of the text message and custom css to 125 by editing the sitewide-settings-page.php on around line 105 size=”50″ to size=”125″ and around line 135 cols=”50″ to cols=”125″. This gave me more room to type the message and custom css.

    Now for the actual support question. Any way to use cookies to remember if the user closes the notice, so it doesn’t keep popping back up each time a new page is visited or current page is refreshed? Would be even better if I could specify time to show again, for instance, have a admin setting in days or hours. So if I say 1 day, then after one day, the user cookie would allow the popup again, but then when closed, stay closed for 1 day again repeating this cycle as long as I have that current site wide message active.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter joeistoybox

    (@joeistoybox)

    Ok, I think I figured out how to fix the ssl problem. Actually, the plugin as is messes up the head section of the loaded page, so it really is a problem for both ssl and plain. Around line 101 in the sitewide-notice-wp.php file,
    change:
    add_action(‘wp_loaded’, ‘swn_banner’)
    to:
    add_action(‘wp_footer’, ‘swn_banner’)

    This way the code gets added to the body without messing up the head section. So far all seems to be working. Just wish it had a cookie function to remember that it has been closed.

    Loving this plugin even more now.

    Plugin Author Andrew Lima

    (@andrewza)

    Hey @joeistoybox!

    Thank you so much for the detailed post it has really helped me out!

    I am actually working on version 2.0 of SiteWide Notice WP which will have way more features and be a lot more stable.

    You are able to use JQuery to hide the banner for X period of time and this is actually what I’m currently working on and it seems relatively easy. I’ll be pushing v2.0 to GitHub fairly soon (I hope) as a pre-release. 🙂

    Thank you for the kind words and the help!

    This plugin started of as a ‘test’ project and I am looking into redoing it even further.

    Thread Starter joeistoybox

    (@joeistoybox)

    Glad I could help. I look forward to trying 2.0 out just as soon as I can. Keep up the great work.

    Thread Starter joeistoybox

    (@joeistoybox)

    Will the JQuery hide it even after navigating to a different page in the same site, and after same page reloads? From what I have been reading, it would require setting cookies. Speaking of cookies, there are a few cookie notice plugins that do hide the notice for X amount of days once the notice has been closed (accepted).
    The JQuery seems to be more suited to delaying the displaying of a div. For instance, 30 seconds into viewing a page, the banner will display, but without the use of cookies, it would continue to fire on every page refresh or navigation 30 seconds later and become very annoying. This would be a cool feature to add as well as long as it could be prevented from firing more than once per day/week/month/year depending on the type of notice or how often to remind visitors of the notice.
    Hope this helps, and maybe I am wrong about cookies being necessary, and an easy fix is just a few lines of code away.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘My tweaks to make this work for me incase anyone else has the same problems.’ is closed to new replies.