• Great plugin! However, I find the alerts become a little annoying after browsing my website for while. One solution is to limit the appearance of the Attention bar strictly to the front page of the WP website. This comes in handy if your entire website is powered by WP and you have a static page selected as your front page.

    I looked for an option in the plugin settings to limit the appearance of the Attention bar only to the front page, but to no success. I’m assuming no such feature is available yet. To that end, I have implemented my own solution by adding two additional lines of PHP syntax to the plugin, until the developer can provide us with an official solution.

    Go to “Plugins” > “Editor” from the WP admin menu, and select “Attention bar” from the drop-down list of installed plugins on the left-hand side of the screen.

    Pay attention to the list of “Plugin Files” also on the left-hand side of the plugin editor screen. Click on the path & file “attention-bar/attention-bar.php”

    Click on the editor text box and search for the following syntax…

    “function nb_add_to_head() {“

    Press the return key to add the following syntax below it…

    “if (is_front_page()) {“

    Go to the end of the function “}” and add another “}” to close the IF statement.

    Done!

    Go to the root/front page of your WP website and you’ll notice the Attention bar is still there and working, but go to any other page or post and you’ll notice it’s gone.

    https://www.ads-software.com/extend/plugins/attention-bar/

  • The topic ‘Attention bar in front page only fix!’ is closed to new replies.