Okay
  Public Ticket #397861
MightyMag Ad Widget
Closed

Comments

  •  1
    Angela started the conversation

    Hi Djwd,

    I want to make the Single Ad Widget open URL's in new windows to keep people on my website. Can you please instruct me how I can go about doing so?

    Thanks


  •  93
    djwd replied

    Hi there,

    if you're using an Ad code such as AdSense it's something you should check with the banner code itself or the provider. I can only help if you're using a fixed image, is that the case?

    Regards
    djwd

    Regards
    djwd

  •  1
    Angela replied

    Hi Djwd,

    Yeah I forgot to mention, its fixed image I am using in the Single Ad Widget

    Thanks

  •  93
    djwd replied

    Hi,

    hence this is more HTML related rather than the theme, you need to add the target attribute to the a tag, as such:

    <a href="google.it" target="_blank">

    Hope it helps

    Regards
    djwd

    Regards
    djwd

  •  1
    Angela replied

    I am using the automated image entering in the Ad Widget. Please see screenshot

  •  93
    djwd replied

    Alright, then you'd need to edit the template file directly. Located in inc/widgets/wg-sidebar.php line 326

    <a href="<?php echo esc_url( $href ); ?>"><img src="<?php echo $image; ?>" alt="<?php echo esc_attr( $alt ); ?>" /></a>

    become:

    <a href="<?php echo esc_url( $href ); ?>"><img src="<?php echo $image; ?>" alt="<?php echo esc_attr( $alt ); ?>" target="_blank" /></a>

    Hope it helps

    Regards
    djwd

    Regards
    djwd

  •  1
    Angela replied

    Thanks djwd