Support » Plugin: Annual Archive » Links opening in a new tab

  • Resolved MarcosBlatt

    (@marcos-blatt)


    Hi @twinpictures,

    I use your plugin and it’s very useful. Congratulations!

    My blog have almost 7.000 posts and the ‘Archive‘ page takes a while to load.

    When a visitor clicks on a link he is redirected to a post but in the same tab/window.

    I’d like visitors to be redirected to a new blank tab to avoid carrying a new loading of that ‘Archive‘ page.

    How do I use target = "_ blank" in all links on that ‘Archive‘ page?

    Thanks in advance.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Contributor twinpictures

    (@twinpictures)

    try adding something like the following to your child-theme’s function.php file:

    function target_get_archives_link( $link_html ) {
        $link_html = preg_replace( '/(<[^\s>]+)/','\1 target="_blank"',$link_html,1 );
    
        return $link_html;
    }
    
    add_filter('get_archives_link', 'target_get_archives_link');
    
Viewing 1 replies (of 1 total)
  • The topic ‘Links opening in a new tab’ is closed to new replies.