• Resolved titusb

    (@titusb)


    Hi Greg,

    how can I configure wpadverts so that all ads are openend in a new tab?

    Thank you!
    Titus

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    there are two ways to do that:

    1. open the wpadverts/templates/list-item.php file and add a target="_blank" param to the <a> tag

    2. paste the below JavaScript in your theme functions.php file or even better create a new blank plugin and paste the code there https://wpadverts.com/blog/how-to-use-code-snippets-in-wordpress/

    
    add_action( "wp_footer", function() {
        ?>
        <script type="text/javascript">
        (function() {
            jQuery(".advert-post-title .advert-link-wrap").attr("target", "_blank")
        })();
        </script>
        <?php
    }, 90000 );
    
    Thread Starter titusb

    (@titusb)

    Great, thank you!

    I’ll use your second suggestion.

    Titus

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Open Ad in New Tab’ is closed to new replies.