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’);
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