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. CTA button for multilingual

CTA button for multilingual

Scheduled Pinned Locked Moved General Discussion
4 Posts 2 Posters 55 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.
  • R Offline
    R Offline
    rotatingcorpse
    wrote on last edited by
    #1

    Re: call to action In the top bar

    Armin, is there a solution to use this with Polylang? I tried this, it works, but is sme
    for both languages...

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

      Screenshot 2024-11-19 at 17.49.52.png

      Screenshot 2024-11-19 at 17.50.06.png

      when u use polylang, the html tag has the language code

      you'd basically create the buttons as i explained here:
      http://laythemeforum.com:4567/topic/9945/call-to-action-in-the-top-bar/2

      but then create multiple buttons:

      <a href="https://google.com" class="call-to-action de-button">Kaufe Hier</a>
      <a href="https://google.com" class="call-to-action en-button">Buy Here</a>
      

      now basically use css to show and hide buttons based on what language we're on:

      .call-to-action{
      display: none;
      }
      
      html[lang="de-DE"] .call-to-action.de-button{
      display: block;
      }
      
      html[lang="en-EN"] .call-to-action.en-button{
      display: block;
      }
      

      sth like that

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rotatingcorpse
        wrote on last edited by
        #3

        Thanks Armin, the result is below and works!

        /* Style for Czech language button /
        html[lang="cs-CZ"] .call-to-action.cs-button,
        html[lang="cs-CZ"] .call-to-action.cs-button._BIG {
        position: fixed;
        top: 7px; /
        Distance from the top of the viewport /
        right: 10%; /
        Position relative to the horizontal center /
        z-index: 10;
        display: block; /
        Ensure the button is visible */
        }

        /* Hide the English button when Czech is active /
        html[lang="cs-CZ"] .call-to-action.en-button {
        display: none; /
        Hide the English button */
        }

        /* Style for English language button /
        html[lang="en-US"] .call-to-action.en-button,
        html[lang="en-US"] .call-to-action.en-button._BIG {
        position: fixed;
        top: 7px; /
        Distance from the top of the viewport /
        right: 10%; /
        Position relative to the horizontal center /
        z-index: 10;
        display: block; /
        Ensure the button is visible */
        }

        /* Hide the Czech button when English is active /
        html[lang="en-US"] .call-to-action.cs-button {
        display: none; /
        Hide the Czech button */
        }

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

          ok very good!

          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
          M
          michaelmaeder
          R
          renno
          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