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

CTA button for multilingual

Scheduled Pinned Locked Moved General Discussion
4 Posts 2 Posters 484 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.
  • R
    R
    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
      arminunruhA
      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/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
        R
        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
          arminunruhA
          arminunruh
          Global Moderator
          wrote on last edited by
          #4

          ok very good!

          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
          D
          Dawid
          L
          lstark
          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