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

    I like to add the target »_blank« to a Column with a Custom Div called ».zwei«.
    Any idas how it works?

    This ist the script I addet to the funktions.php to call the Custom Div:

    function add_custom_div(){
    ?>
    <script>
    jQuery(“.zwei”).click(function(){
    window.location = jQuery(this).find(“a:first”).attr(“href”);
    return false;
    });
    </script>
    <?php
    }
    add_action(‘wp_footer’, ‘add_custom_div’);

    #718938

    Hi ThoNeumann!

    Please add following code to Functions.php file in Appearance > Editor

    function av_custom_target(){
    ?>
     <script>
    jQuery(window).load(function(){
    jQuery('.zwei a').attr('target','_blank');
    });
     </script>
    <?php
    }
    add_action('wp_footer', 'av_custom_target');

    Best regards,
    Yigit

    • This reply was modified 7 years, 11 months ago by Yigit.
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.