Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter buddybuddy123

    (@buddybuddy123)

    I read this thread:

    studiojbcc 

    (@jorisbudel)

    2 years, 6 months ago

    Would be nice if links could be opened in new tabs with target=”_blank”.

    wpdever 

    (@wpdever)

    2 years, 6 months ago

    Hi,

    Thanks for your suggestion. I’ll add this option in the next update.

    —-

    But it doesn’t appear it was ever added to the plugin.. unless I’m missing something.

    Plugin Author wpdever

    (@wpdever)

    Hi,

    I’ve just added the filter to be used for this. You can update the plugin then in your theme’s functions.php file, add:

    add_filter('wnbell_link_target', function ($target) {
    return '_blank'; // Open all links in a new tab
    });

    Thread Starter buddybuddy123

    (@buddybuddy123)

    Thanks for the reply, @wpdever

    I updated the plugin and added that code to my functions.php file but the links still do not open in a new tab..

    If you click the bell in the main menu, you’ll see they still do not. Cleared my cache, and browser cache to make sure.. https://nagolbud.com/

    Thread Starter buddybuddy123

    (@buddybuddy123)

    Thanks for the reply, @wpdever

    I updated the plugin and added that code to my functions.php file but the links still do not open in a new tab.. I click the little bell in the main menu, drop down menu of manually added nonfictions, click, same tab.

    .wnbell_notification_item_menu a

    Plugin Author wpdever

    (@wpdever)

    Could you please send the website link to [email protected] and how to access the bell on the site?

    Plugin Author wpdever

    (@wpdever)

    Is the bell displayed by enabling the “Add bell icon to menu for visitors” option?

    Can you add the code directly to the plugin’s wp-notification-bell.php at the bottom, just to test?

    Thread Starter buddybuddy123

    (@buddybuddy123)

    Yes @wpdever , both:


    Add bell icon to menu for logged-in users

    Add bell icon to menu for visitors

    Are enabled.

    Adding the code directly to the bottom of wp-notification-bell.php does work now, they open in a new tab.

    Plugin Author wpdever

    (@wpdever)

    The code will disappear if you update the plugin in the future.

    Can you check why it doesn’t work in functions.php? Maybe change the position of the code or verify if it’s the right theme.

    Thread Starter buddybuddy123

    (@buddybuddy123)

    I found the error.

    I am using the plugin “Code Snippets” to add code to my functions.php file so I don’t have to open up hosting each time / get deleted in theme updates, and switching the options from:

    • Only run code on site front-end

    TO

    • Run snippet everywhere

    Fixed the problem. The links are now opening in a new tab correctly without having to manually place the code in the wp-notification-bell.php file.

    All is good. Thanks for your help!

    Plugin Author wpdever

    (@wpdever)

    Glad it worked! And thanks for letting me know about this fix.

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.