Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • 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. individual head content

individual head content

Scheduled Pinned Locked Moved General Discussion
12 Posts 3 Posters 72 Views
  • 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.
  • F Offline
    F Offline
    felix_rabe
    wrote on last edited by felix_rabe
    #2

    @jonathansteffens you can infuse this with javascript:

     document.addEventListener('DOMContentLoaded', function() {
         // Check if we're on the footer page
         if (document.body.classList.contains('page-id-XX')) { // Replace XX with the actual page ID of your footer page
     
             // Check if a robots meta tag already exists
             var existingMetaTag = document.querySelector('meta[name="robots"]');
             
             if (existingMetaTag) {
                 // If it exists, update its content to "noindex, nofollow"
                 existingMetaTag.content = "noindex, nofollow";
             } else {
                 // If it doesn't exist, create a new meta tag
                 var metaTag = document.createElement('meta');
                 metaTag.name = "robots";
                 metaTag.content = "noindex, nofollow";
                 document.getElementsByTagName('head')[0].appendChild(metaTag);
             }
         }
     });
    
    1 Reply Last reply
    0
    • J Offline
      J Offline
      jonathansteffens
      wrote on last edited by
      #3

      thats a very good idea, thank you!

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

        the problem is that the page overlay links are actually links to pages in the html code right?
        and thats why google lists them as pages you can visit.

        is my assumption right? this would mean you use footer and menu as page overlays?

        1 Reply Last reply
        0
        • J Offline
          J Offline
          jonathansteffens
          wrote on last edited by
          #5

          thats absolutely right!

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

            so i did implement a:
            <a rel="nofollow"

            for the burger menu page overlay links:

            Screenshot 2025-04-10 at 20.52.25.png

            this will be part of the next lay theme update.
            but for other links to page overlays like in menus i will need to create a nofollow for these too

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

              do you use menu links to these page overlays?
              or burger icon like in the screenshot above?
              or just links in +text in the gridder?

              for text elements in the gridder i would need to implement a nofollow checkbox

              1 Reply Last reply
              0
              • J Offline
                J Offline
                jonathansteffens
                wrote on last edited by
                #8

                hi, that would be awesome if you implemented this. i use the burger icon option and the footer option

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  jonathansteffens
                  wrote on last edited by
                  #9

                  Bildschirmfoto 2025-04-11 um 10.02.06.png
                  Bildschirmfoto 2025-04-11 um 10.03.01.png

                  the site is friederike-dudda.de

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    jonathansteffens
                    wrote on last edited by
                    #10
                    window.laytheme.on("newpageshown", function () {
                    if (
                        document.body.classList.contains("page-id-146") ||
                        document.body.classList.contains("page-id-81")
                      ) {
                         
                        //redirect
                        window.location.href = "/";
                          
                        // Check if a robots meta tag already exists
                        var existingMetaTag = document.querySelector('meta[name="robots"]');
                    
                        if (existingMetaTag) {
                          // If it exists, update its content to "noindex, nofollow"
                          existingMetaTag.content = "noindex, nofollow";
                        } else {
                          // If it doesn't exist, create a new meta tag
                          var metaTag = document.createElement("meta");
                          metaTag.name = "robots";
                          metaTag.content = "noindex, nofollow";
                          document.getElementsByTagName("head")[0].appendChild(metaTag);
                        }
                      }
                    });
                    

                    this is what i did now (following the proposition above). i added a redirect, which doesnt seem to be a problem for the functionality of the menu and the footer.

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

                      alright

                      the next lay theme version will:

                      • have a nofollow checkbox when setting links:
                        Screenshot 2025-04-11 at 10.29.03.png

                      and any links to page overlays in menus and as burger icons will be rel="nofollow" automatically.

                      1 Reply Last reply
                      0
                      • J Offline
                        J Offline
                        jonathansteffens
                        wrote on last edited by
                        #12

                        šŸ‘
                        thank you

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        I also code custom websites or custom Lay features.
                        šŸ’æ Email me here: šŸ’æ
                        info@laytheme.com

                        Before you post:
                        1. When using a WordPress Cache plugin, disable it or clear your cache.
                        2. Update Lay Theme and all Lay Theme Addons
                        3. Disable all Plugins
                        4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

                        This often solves issues you might run into

                        When you post:
                        1. Post a link to where the problem is
                        2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
                        3. If the problem is difficult to explain, post screenshots / link to a video to explain it
                        Online Users
                        O
                        oli
                        P
                        piranha
                        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