• how do you target one or the other of two instances of current-page-item (which occurs when the same subpage is under more than one parent)? i have tried

    li.current-page-parent:nth-child(1)
    and
    li.current-page-parent:not(:nth-child(1))

    and its variants, to no avail. i need to remove highlighting on nonprimary current page item.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator cubecolour

    (@numeeja)

    Can you link to a page on your site where the current page is under two parent pages in he menu?

    Thread Starter judyhicks

    (@judyhicks)

    Moderator cubecolour

    (@numeeja)

    How do you ascertain which is the primary and which is the non-primary current page item?

    The only apparent difference between the two menu item links for that page are the menu-item-xxx classes

    I’m not sure whether this will help but you should be able to target each specifically when they are the current menu item using

    .current_page_item.menu-item-617

    or

    .current_page_item.menu-item-616

    Thread Starter judyhicks

    (@judyhicks)

    The page is set as a child page of Work (can only have one parent, therefore only one url). So I am fine that the links go to /work/sculpture. I just don’t want both of the links Work and Play to be highlighted whenever you are at that url.

    Those selectors don’t work, but thanks for helping.

    Moderator cubecolour

    (@numeeja)

    OK try these – the classes were getting overidden by the default CSS, so using the menu item IDs might be better:

    #menu-item-626.current_page_item a {
    	background: #ff1493;
    }
    #menu-item-627.current_page_item a {
    	background: #7fff00;
    }

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘multiple current page items’ is closed to new replies.