• Resolved andrewkow

    (@andrewkow)


    Hi,

    Is there possible to display the notification bar on a specific path like:

    domain.com/food-and-drinks/XXX

    Which means the bar will only show on all the pages after food-and-drinks/

    Thanks

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Support Swathi S

    (@swathiswpfront)

    Hello,

    You can use the “wpfront_notification_bar_enabled” filter. Do your path check in it, then return true or false.

    Thanks,
    Swathi

    Thread Starter andrewkow

    (@andrewkow)

    Hi Swathi,

    Do you mean the path like this in the screenshot?

    Plugin Support Swathi S

    (@swathiswpfront)

    Hello,

    Have you ever used WordPress filters before?

    This will be a PHP code which will usually go into your theme’s functions.php.

    Thanks,
    Swathi

    Thread Starter andrewkow

    (@andrewkow)

    Hi Swathi,

    I’m not familiar with PHP code as I’m not a developer.

    I’ll be much appreciated if could you please share with me? I’ll insert it to the functions.php from the child theme.

    Thank you

    Plugin Support Swathi S

    (@swathiswpfront)

    Hi @andrewkow, `

    We’d be happy to help!

    Can you please try the below code?

    add_filter('wpfront_notification_bar_enabled', function(){
       return strpos($_SERVER['REQUEST_URI'], 'food-and-drinks')!==false;     
    });

    Thanks!

    • This reply was modified 3 years, 4 months ago by Swathi S.
    • This reply was modified 3 years, 4 months ago by Swathi S.
    Thread Starter andrewkow

    (@andrewkow)

    Hi,

    Thanks for the code! I tried to insert the code and saved in function.php but it does not work. Please refer to the screenshot of the sample page.

    Is the url path issue?

    Plugin Support Swathi S

    (@swathiswpfront)

    Hi,

    From our end, we tested and everything works fine.

    Thanks,
    Swathi

    Thread Starter andrewkow

    (@andrewkow)

    Hi,

    Is your code is with the url path are correctly reflect with the url address on the screenshot? I just want to double confirm.

    Appreciated your kind assist.

    Thanks

    Plugin Support Swathi S

    (@swathiswpfront)

    Hello @andrewkow,

    I checked your site and noticed that the notification bar HTML is present.So the bar is not displaying because of some other reason.

    When you get the chance could you please troubleshoot by following the steps mentioned in below link?

    https://wpfront.com/wordpress-plugins/notification-bar-plugin/wpfront-notification-bar-troubleshooting/

    I hope this helps and can you please let me know if you have other questions?

    Thanks!

    Thread Starter andrewkow

    (@andrewkow)

    Hi,

    I’ve checked with the method you shared. I suspect the 2 issues may causing the problem.

    One is “Running in wp-admin, ignoring filters.”
    Another is “Waiting for Cookies.”

    I tried to clear the caching and it does not work also. Please advice what should I do next.

    THank you

    Plugin Support Swathi S

    (@swathiswpfront)

    Hi,

    Can you please disable all of your site’s plugins except for WPFront Notification Bar, to confirm and rule out any code conflicts on your site?

    After disabling all other plugins, please do a test to see if the issue persists.

    Thanks!

    Plugin Support Swathi S

    (@swathiswpfront)

    Resolving due to inactivity. If you have any queries please feel free to get in touch with us.

    Thanks,
    Swathi S

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Display notification on specific path’ is closed to new replies.