Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1077780

    Hello,

    I am trying to define a target for the Button.
    The button widget doesn’t have any possiblitiy to define a custom target. That’s why I use the code-widget.

    [av_button label='Zurück zur Übersicht' link_target='_main' link='manually,https://intranet.weber.wor/' size='medium' position='left' icon_select='yes' icon='ue841' font='entypo-fontello' color='theme-color' custom_bg='#444444' custom_font='#ffffff' av_uid='av-5obiu2z']

    “_main” is my custom target. But its not rendered.

    Below you see the result which is genrated:

    <section class="avia_codeblock_section  avia_code_block_0" itemscope="itemscope" itemtype="https://schema.org/CreativeWork">
    <div class="avia_codeblock " itemprop="text"> 
    <div class="avia-button-wrap avia-button-left ">
    
    <a href="https://website.com/" class="avia-button   avia-icon_select-yes-left-icon avia-color-theme-color avia-size-medium avia-position-left "><span class="avia_button_icon avia_button_icon_left " aria-hidden="true" data-av_icon="" data-av_iconfont="entypo-fontello"></span><span class="avia_iconbox_title">Back to overview</span></a>
    </div>
    </div>
    </section>

    Do you have any advice?

    Thanks in advance,
    Sepppl

    #1079332

    Hey Sepppl,
    Sorry for the late reply, we can add the custom target with jQuery if you add a custom class in your shortcode.
    Try adding this code to the end of your functions.php file in Appearance > Editor:

    function custom_script(){
      ?>
      <script>
    (function($){
      $(document).ready(function(){
      $('a.custom-class').attr('target','_main');
      });
      })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_script');

    for this example the custom class is “custom-class”

    Best regards,
    Mike

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.