• someone else might find this handy. and someone else might be able to improve upon it (hopefully).

    i’m trying to manage a section menu from within the header (which will eventually be horizontal) without needing to resort to includes to make it work across categories, and sub-categories (and posts) and pages and subpages.

    so far i have this:
    https://pastebin.com/397947

    and that works to make the menu on the child page
    the same as the parent page

    and the menu on the child category
    the same as the parent category

    AND i can now have color-coding styles which i will name after the ‘nicename’ version of each top-level page or category… so class="mycategory" will match to a series of
    .mycategory {
    background : blue;
    }
    etc…

    but i’m still stuck on how to get something like the ‘current_page_item’ (which appears in the li class for the ‘current page’) into the li for the sub-categories.

    any other links, tips, suggestions welcome.

Viewing 1 replies (of 1 total)
  • Thread Starter nearlythere

    (@nearlythere)

    making some progress.

    i installed this great plugin: Category Highlight
    https://adahas.com/work/cathighlight/
    and i changed line 45 to have the class="current_page_item" so it’s the same as the pages

    i wanted to be able to colour code within a section, and it’s children sections. lucky for me, my pages and categories are separate.

    parent page (orange)
    – child page
    – child page

    parent page (blue)
    – child page
    – child page

    parent category (green)
    – child category
    – child category

    parent category (purple)
    – child category
    – child category

    this is where i am so far, but it’s very sloppy since i don’t know PHP, i just hack away at it.
    https://pastebin.com/398725

    right now it’s working very well, and highlighting the right page/category.

    anyway, this might be useful for anyone with same set up.

Viewing 1 replies (of 1 total)
  • The topic ‘feedback? color coded menu across posts and pages’ is closed to new replies.