• Resolved rocknroll7770

    (@rocknroll7770)


    Let’s say I have a menu tab called “Recipes,” with the sub-categorires, “Breakfast, Lunch and Dinner” underneath as a submenu.

    But I would not want the page ‘Recipes’ to be linkable, it should be ‘non-functional’ as the page would be empty anyway. Only ‘breakfast, lunch and dinner’ should be clickable/hyperlinked and open a new page.

    How do I cancel the hyperlink on the parent?

    P.S. I am also using Thesis 1.8

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

    (@rocknroll7770)

    Unfortunately I am using the Thesis_nav_menu and not the WP_nav_menu which is probably why this plug-in won’t work for me : (
    But thank you for your help.

    Can you give link of your website?

    Let me find some other way.

    Thread Starter rocknroll7770

    (@rocknroll7770)

    Oh thanks, you are very kind!

    This is the site.

    So far I believe I have to find the ‘page ID’ and then hide it using CSS.
    I found this here: https://buynowshop.com/hide-me/

    .page-item-220 {visibility:hidden;} or .page-item-220 {display:none;}

    My page ID seems to be post=18 is that correct and what would that make the css?

    I’m still a beginner so my knowledge is very limited. ; )

    try to add following code in your footer.php

    <script type="text/javascript">
       jQuery("#page li:has(ul.submenu)").hover(function () {
         jQuery(this).children("a").removeAttr('href');
         jQuery(this).children("a").click(function () {
             return false;
         });
       });
    </script>
    Thread Starter rocknroll7770

    (@rocknroll7770)

    Ok, unfortunately I’m not sure where exactly I should put this.
    As I’m using Thesis I put it into
    Custom File Editor > custom_functions.php
    and that didn’t work, the site crashed.

    Not sure if you’re familiar with Thesis. I REALLY appreciate you taking time out for this.

    sorry i am not familiar with Thesis.

    But you need to put above code in footer.php just above </body> tag

    Thread Starter rocknroll7770

    (@rocknroll7770)

    Kapil,
    thank you so much I have figured it out with the help of some forum members. Your link works perfectly but when using ‘Thesis’ one must paste the following into ‘custom_functions.php’

    function custom_footer_script() { ?>
    <script type=”text/javascript”>
    jQuery(“#page li:has(ul.submenu)”).hover(function () {
    jQuery(this).children(“a”).removeAttr(‘href’);
    jQuery(this).children(“a”).click(function () {
    return false;
    });
    });
    </script>
    <?php }
    add_action(‘thesis_hook_after_html’, ‘custom_footer_script’);

    You also need to have jQuery enabled – you can do that in Thesis under Design Options > Javascript > Sitewide JS Libraries; otherwise, you’d have to add the JS call yourself to your current function.

    Best wishes to everyone out there ; )

    Thanks for sharing this rocknroll7770

    I’m having the exact same problem with a Thesis 1.8 site. But I’ve done precisely what’s described, double-checked it a number of times, and it’s still not working. I can’t figure out what the problem is. I was able to get this working perfectly with no problems on another Thesis WP site.

    I tried setting it to the full page framework and changing #page to .page to see if that would knock something loose, but no success.

    Can anyone offer any insight or trouble-shooting approaches? I’m working on this site for a friend.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Cancel hyperlink in Nav Menu parent’ is closed to new replies.