Home Forums Travel WordPress Theme Navigation issue with current menu item

This topic contains 13 replies, has 2 voices, and was last updated by  Johnny 3 years, 3 months ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #3725

    Nooriji
    Participant

    There is the menu with several category based items in the footer.
    How can I add a custom css to the current link the user is in. I want to highlight the current category link and remove the link, so that is for the user obvious which menu part was chosen.
    In other themes I had classes like current-menu-item for that issue, but I cannot find something like that in your theme.

    #3729

    Johnny
    Participant

    Hi, please open file js/main.js and find this:

    if(jQuery(this).attr("act") == "noajax") {
    						window.location.href=this.href;
    					}

    right after it add this:
    `jQuery(“#foot #navi li”).removeClass(“current-item”);
    jQuery(this).closest(‘li’).addClass(“current-item”);`
    Best

    #3730

    Nooriji
    Participant

    I added the code as you described, but

    1. I couldn’t address .current-item with Custom CSS .
    .current-item {display:none; visibility:hidden !important; } didn’t work

    2. As you see in the.way.is, there is the search field next to the menu items.
    Very correctly it pushes the menu items to the left, when one wants to do a search. Nice effect.
    But when I add in main.js this additional code, then this effect is gone and the search field doesn’t open at all.

    #3735

    Johnny
    Participant

    Hi,
    1. I have checked your site http://the.way.is/ and not find the added script. please make sure to added it and with right position.
    2. the added script should not effect the search bar if it added correctly.
    Thank you

    #3741

    Nooriji
    Participant

    Yup, you couldn’t find the added script, because I removed it again.

    Now it is added as you suggested. I tried both ways – once with the apostrophes at the beginning and end and once without the apostrophes.
    In both cases the search box doesn’t push the two menu items to the left as it did very nicely without the script addition. Additionally the text search box doesn’t open.

    In style.css ‘ #foot #navi .current_item {display:none; visibility:hidden !important; } ‘ was added – without any result of NOT showing the current menu item.
    .current_item {display:none; visibility:hidden !important; } is just for testing – actually I want to give the current-menu item a different font-size, -weight,-color and remove the link, so that the user cannot load the same page again. The current-item should only indicate, which page the user is in.

    #3742

    Nooriji
    Participant

    Another “side-effects” of your suggested addition:
    1. the whole #foot #navi (menu, logo and search) do NOT disappear when seeing a fullscreen gallery.
    2. the path is shown completely – for example http://the.way.is/test-gallery-post, etc. With the original main.js it is only and always http://the.way.is/# – a solution, which I prefer a lot.

    • This reply was modified 3 years, 3 months ago by  Nooriji.
    #3744

    Nooriji
    Participant

    Another “side-effect”: The audio player doesn’t show up anymore.

    #3746

    Johnny
    Participant

    Hi, please remove the single quotes at the benging and the end of the added script.
    Best

    #3747

    Nooriji
    Participant

    Hi,

    quotes are removed. No difference.
    Another side-effect: Submenus don’t appear.

    Obviously the suggested addition is breaking a lot of things.

    • This reply was modified 3 years, 3 months ago by  Nooriji.
    #3757

    Johnny
    Participant

    Hi, I have checked your site just now. single quotes already there. so please replace added script completely with attached iamge showing,
    Thank you

    #3760

    Nooriji
    Participant

    Yup, you were right – the quotes were still there. Sorry.
    Have removed them now, but nothing changed.

    Btw … couldn’t open the pic fully. The only thing I could see and download see attached image.

    #3769

    Johnny
    Participant

    Hi, please using attached file replace the original file js/main.js.
    Best

    #3771

    Nooriji
    Participant

    Hi,

    now it works … so great !

    I saw that you added the same lines, but with some space in between.
    Was that the only flaw or did you need to add code somewhere else ? Would be good to know for me.

    Anyway, thanks for the great support … You definitely deserve 5 stars in Themeforest 🙂

    #3778

    Johnny
    Participant

    Hi, thank you for your compliment. you added the script with wrong single and double quotes, I only correct them.
    Best

Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic.