Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1372053

    Hey Enfold-Team,

    is there a possibility to add a CTA-Button only to the mobile menu?

    The result should have a button like this: https://sfvoe.de/wp-content/uploads/2022/11/CTA-mobile.jpg

    Thank you in advance!

    Kind regards
    Jonas

    #1372094

    Hi Jonas,

    The image you shared is not loading on my end, please try uploading it to a service like Snipboard or Imgur instead.

    Best regards,
    Rikard

    #1372133

    Hi Rikard,

    thank you for your response! Next try: Image

    Kind regards
    Jonas

    #1372154

    Hi,

    Thank you for the update.

    You can add this code in the functions.php file to insert an element inside the header.

    add_action('ava_main_header', function() {
        $output = '<div class="av-cta-button av-desktop-hid av-tablet-hide av-button"><a href="#">Click Here</a></div>';
        echo $output; 
    }, 10);
    

    Then add this css code to adjust the style of the element.

    .av-cta-button {
       position: relative;
       top: 10px;
       right: 10px;
    }

    We already set the html above so that the button element is only visible on mobile view.

    Best regards,
    Ismael

    #1372169

    Hey Ismael,

    thank you very much for the quick response and the solution! Unfortunately the code in the functions.php causes the theme to crash. Might there be a mistake?

    Kind regards
    Jonas

    #1372365

    Hi,
    I have tested the functions.php code and it works correctly, perhaps you copied the code from an email please copy the code from the forum.
    If you continue to have trouble please include admin login in the Private Content area so we can be of more assistance.

    Best regards,
    Mike

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Button in Mobile Header’ is closed to new replies.