WordPress.org

Ready to get started?Download WordPress

Forums

disabling "alt" attribute when hovering over navigation (25 posts)

  1. roberthq
    Member
    Posted 3 years ago #

    I know this question has been asked in the past years ago, but I've found nothing recent that applys to new versions of WP. How do I disable the alt pop up when you hover over your nav? This seems to be a WP standard feature and i think its annoying.

    If you need to see it in action, do so here: http://www.hqprints.net/

    Thank you for reading.
    RRG

  2. Mark / t31os
    Moderator
    Posted 3 years ago #

    How are you generating your menu?

  3. roberthq
    Member
    Posted 3 years ago #

    They are categories and posts. I've removed any description from the category options, but it still defaults to the original "view all posts..." I can't even find that in the code of some of the WP files (not all, sort of time consuming to do, hence why i'm here)

    Does this answer your question?

    Thanks for reading
    RRG

  4. Mark / t31os
    Moderator
    Posted 3 years ago #

    What "code" are using to generate the menu(sorry should of been more clear), are you using the new 3.0 nav menu system? ie. wp_nav_menu()?

  5. roberthq
    Member
    Posted 3 years ago #

    I'd guess not as the theme is older and I don't updated it. In fact I know I'm not using it as I've used it in newer websites, but not this one as it was build with older versions of WP.

  6. ekdor
    Member
    Posted 3 years ago #

    I'm also looking for a way to turn off this popup description. It's very annoying.

  7. PGrizz
    Member
    Posted 3 years ago #

    Wow a WordPress post on a problem I have that isn't 5 years old. I'd also like to know how to turn this feature off...

  8. ekdor
    Member
    Posted 3 years ago #

    @ Mark / t3102

    My theme is using wp_nav_menu() Going to research and mess with it for a bit and see if I can understand how it works a bit more.

  9. ambrosite
    Member
    Posted 3 years ago #

    roberthq,

    If you are using an older theme, it's probably using wp_list_pages to generate your nav menus. Two points:

    1) It's actually the 'title' attribute, not the 'alt' attribute, that is causing the tooltip to pop up.
    2) Filtering the output of wp_list_pages is quite difficult -- I know because I wrote a plugin that does it (but for a different reason).

    For something like this, I would probably use JavaScript. Since your theme already has jQuery loaded, if you put this little piece of code in your template it should do the trick.

    <script type='text/javascript'>
    jQuery(document).ready(function($) {
      $('#nav a').attr('title', '');
    });
    </script>

    ekdor and PGrizz,

    Something similar should work for you, assuming jQuery is loaded. You'll have to modify the CSS selector in the code to match your theme.

  10. ambrosite
    Member
    Posted 3 years ago #

    I just remembered there is another way to do this, BUT it will only work for menus that are generated with wp_list_pages:

    http://wordpress.org/extend/plugins/page-lists-plus/

    Install the plugin, then under "Page Lists Plus" in the Settings menu, check "Remove title attributes from anchors." (Page Lists Plus is not one of my plugins btw, it's just something I came across a while back).

    If you are using the WP 3.x custom menu system (i.e. wp_nav_menu) this will NOT work. You'll have to try the JavaScript solution instead.

  11. ekdor
    Member
    Posted 3 years ago #

    @ ambrosite
    I'm not great at this stuff but I think I can manage.

    jQueary is in use with my theme.

    I placed the code in the php where I have the menu residing. Is that correct?

    I assume you mean the #nav needs to be changed? If so, what kind of css styling should I be applying? What am I matching it to?

    Sorry if this a bit noob for ya.

  12. ambrosite
    Member
    Posted 3 years ago #

    @ekdor You need to supply the correct selector for your navigation links (it's different in every theme), so jQuery knows which elements should be changed. If you give me the link to your site, I'll tell you exactly what you need to put in there.

  13. roberthq
    Member
    Posted 3 years ago #

    @ambrosite
    Thanks for that tip, worked like a charm.

    RRG

  14. ekdor
    Member
    Posted 3 years ago #

    @ ambrosite

    Thanks for your assistance. The site in question is http://www.burramundi.com

  15. ambrosite
    Member
    Posted 3 years ago #

    @ekdor Try this:

    <script type='text/javascript'>
    jQuery(document).ready(function($) {
      $('.sf-menu a').attr('title', '');
    });
    </script>
  16. ekdor
    Member
    Posted 3 years ago #

    @ ambrosite
    Thanks. That didn't work. I tried also sorts of permutations earlier. Although non with the dot. But this didn't work.

    Perhaps I have it in the wrong file? Or the jQueary scripts don't include what I need? There are three by the following names. I don't know if these had been altered.

    jquery.cycle.all.min.js
    jquery.easing.1.3.js
    jquery.lavalamp.1.3.3-min.js

  17. ambrosite
    Member
    Posted 3 years ago #

    It worked when I tested it on your site using Greasemonkey. Where exactly are you pasting that code?

  18. ekdor
    Member
    Posted 3 years ago #

    @ ambrosite
    Ok have it working. Seems to work when I put that script in a shortcodes file containing some tootip code.

    Thank you for all your assistance. very much appreciated. Cheers,.

  19. ekdor
    Member
    Posted 3 years ago #

    @ ambrosite
    Just got your reply. I was putting it into the header.php file where my menu php is situated.

  20. ambrosite
    Member
    Posted 3 years ago #

    You're welcome. I would have put it in header.php myself; I'm not sure why it wasn't working there, but as long as it's working for you now that's the important thing. :)

  21. ekdor
    Member
    Posted 3 years ago #

    @ ambrosite
    Yea I'm no pro but I assumed it would work there also. But tried it on my other site and the same thing happens. I think it might be to do with the shortcodes implementation.

    The original themes were created by someone else whom has given me permission to alter them. They look nothing like their originals. But much of the implementation of scripts and the general framework remains close to how it was.

    Cheers,.

  22. nodell
    Member
    Posted 3 years ago #

    <script type='text/javascript'>
    jQuery(document).ready(function($) {
    $('#nav a').attr('title', '');
    });
    </script>

    WOW! That worked for me!! YAY! Thanks so much!

  23. nodell
    Member
    Posted 3 years ago #

    Oh no! They're back. UGH!

    Any idea why??

    Thanks!

  24. nodell
    Member
    Posted 3 years ago #

    Okay, it's gone again. I tried this one:

    <script type='text/javascript'>
    jQuery(document).ready(function($) {
    $('.sf-menu a').attr('title', '');
    });
    </script>

    and it seem to have worked.

    Thanks!

  25. nodell
    Member
    Posted 3 years ago #

    Nope, they're back. ARRRGHHH!

Topic Closed

This topic has been closed to new replies.

About this Topic