Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. submenu — mark first level as active

submenu — mark first level as active

Scheduled Pinned Locked Moved General Discussion
16 Posts 2 Posters 1.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B
    B
    bbbfg
    wrote on last edited by
    #7

    that would be nice, thanks.
    The site is still in development, so can I send the link in private?

    1 Reply Last reply
    0
    • B
      B
      bbbfg
      wrote on last edited by
      #8

      can I? :)

      1 Reply Last reply
      0
      • arminunruhA
        arminunruhA
        arminunruh
        Global Moderator
        wrote on last edited by
        #9

        can you send your website address, /wp-admin/ username and password and a link to this topic to info@laytheme.com?

        1 Reply Last reply
        0
        • B
          B
          bbbfg
          wrote on last edited by
          #10

          thanks, I did so

          1 Reply Last reply
          0
          • arminunruhA
            arminunruhA
            arminunruh
            Global Moderator
            wrote on last edited by
            #11

            so by looking at your website, it seems that you dont use submenus.

            solution 1:

            you have a menupoint "projekte".
            this is a page.

            if it was a category page in "wp-admin" -> "projects" -> "categories"
            create a category called "projekte" or rename the default category to "projekte"
            now make sure to assign this category to all existing projects.

            now in "wp-admin" -> "projects" -> "categories", click on the category "projekte"
            in here, you will have a gridder. put your thumbnailgrid here or whatever you want.

            now in "appearance" -> "menus", in your menu use the newly created category page instead of a normal page

            now whenever you're in a project that uses this category, that menupoint will be active.

            alternative solution 2:

            <script>
            window.laytheme.on('newpageshown', function(e){
            	if(jQuery('body').hasClass('type-project')) {
            		jQuery('.menu-item-18').addClass('current-menu-item');
            	}
            });
            </script>
            

            your menu item that is the projects menu item has a html class of "menu-item-18". I found this out by using the chrome inspector. Every browser has an html inspector tool.

            We can add the class "current-menu-item" to it, whenever we're on a project type page. This is what the script does.

            Enter this css in "lay options" -> "custom css & html" -> "custom head content"

            With solution 1 its easier to get it right if for example you have multiple types of project categories and multiple menu items that should stay activated when you're in a project with one of these categories.

            1 Reply Last reply
            0
            • B
              B
              bbbfg
              wrote on last edited by
              #12

              Thanks so far, but this would not be a solution for the whole page, I think?! Maybe I still missed to become clear enough:

              The active "top-Menu" should be should also hav the active status, when the sub-site is active, on all sub-pages on the site, such as on e.g. "büro". They are all listed as "sub-sites" in the admin-area.
              Meaning when I open the page "team" — which is a subset to "Büro" — the according top-menu-item "büro" should be set as "active, in this case 50% grey.
              Can you have a look, thanks.

              1 Reply Last reply
              0
              • arminunruhA
                arminunruhA
                arminunruh
                Global Moderator
                wrote on last edited by
                #13
                <script>
                window.laytheme.on('newpageshown', function(e){
                	if(jQuery('body').hasClass('type-project')) {
                		jQuery('.menu-item-18').addClass('current-menu-item');
                	}
                	else if(jQuery('body').hasClass('type-lay_news')){
                	    jQuery('.menu-item-15').addClass('current-menu-item');
                	}
                	if(window.location.href.indexOf('/buero/') !== -1){
                	    jQuery('.menu-item-17').addClass('current-menu-item');
                	}
                });
                </script>
                

                i inserted this script to your page this should work for now

                you're right, for subpages i should make it work by default
                im writing it down

                1 Reply Last reply
                0
                • arminunruhA
                  arminunruhA
                  arminunruh
                  Global Moderator
                  wrote on last edited by
                  #14

                  but basically its about menupoints getting the active state when we are on a subpage and the menupoint is the menupoint of a parent page.

                  there is no submenu here like this one: https://laytheme.com/documentation/menus.html#submenus

                  thats why i didnt understand the issue at first

                  1 Reply Last reply
                  0
                  • arminunruhA
                    arminunruhA
                    arminunruh
                    Global Moderator
                    wrote on last edited by
                    #15

                    but for the case "projekte" menupoint you could still use my solution 1:
                    http://laythemeforum.com/topic/10772/submenu-mark-first-level-as-active/11

                    however, then the permalink would be /category/projekte

                    not sure if u want that

                    1 Reply Last reply
                    0
                    • arminunruhA arminunruh referenced this topic on
                    • B
                      B
                      bbbfg
                      wrote on last edited by
                      #16

                      thank you thank you thank you!
                      I will have a look at it and would be getting back to know when I have more questions.

                      1 Reply Last reply
                      0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      Online Users
                      Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
                      laytheme.com
                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Search