Okay
  Public Ticket #171315
PowerMag - Single Ad Widget
Closed

Comments

  • Jackson started the conversation
    Hi I have placed the PowerMag Single Ad Widget on my homepage, but when the ad is clicked the user is taken away from my website. Is there a way the ad link can open up in a new window? Note: If it makes any difference I'm not using the Ad Code option in this instance. Thanks!
  •  93
    djwd replied

    Hi there,

    that's the default behavior, as users should be able to decide whether they want to open a link in a new window or not. If you entered manually an image ad through HTML code, please post it here and I'll tell you how to edit it to force opening the link on a new window though.

    Regards
    djwd

    Regards
    djwd

  • Jackson replied

    Hi

    No I didn't enter it manually, I entered it through the standard widget box (see attached).

    If I need to update the HTML for this, where do I find it?

    Many thanks!

  •  93
    djwd replied

    The widget code is located in inc/widgets/wg-sidebar.php

    On line 556 you should add the target attribute, replace this:

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

    With this:

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

    Hope this helps

    djwd

    Regards
    djwd

  • Jackson replied

    Thank you for the brilliant support!