• Resolved reclaimedpress

    (@reclaimedpress)


    I am using:
    – Astra theme with infinite scroll enabled on blog and archives (infinite scroll is an in-built function of astra, not part of another plugin)
    – the content within archives and blogs are all external links (there are no single pages
    – this external links plugin works as expected on initial load — yay!
    – content loaded on scroll (after initial load) do not open in an external window
    – external links works fine when infinite scroll is disabled and ‘old-school’ pagination is enabled

    I experimented with Bimber and its infinite scroll function, and had the same issue there.

    This is the extent of my isolation and troubleshooting. Any help you can provide will be greatly appreciated!

    Thanks!

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author WebFactory

    (@webfactory)

    The behavior is undesired but, unfortunately, expected. Extra content is loaded via AJAX is not parsed by our plugin (unlike the initial content loaded “normally”). Hence, the links don’t have target="_blank". Without modifying the plugin or the theme this can’t be fixed. Sorry.

    Thread Starter reclaimedpress

    (@reclaimedpress)

    Thanks for getting back to me! Understood. I was able to find a solution. While I lose the bells and whistles of your plugin, it does the trick for me.

    If anyone else is running into this issue, I used the Snippets plugin to add the following to the header of all my front-end pages:

    <script>
    
    /** 
     * Open all external links in a new window
     */
    jQuery(document).ready(function($) {
    	$('a')
    		.filter('[href^="http"], [href^="//"]')
    		.not('[href*="' + window.location.host + '"]')
    		.attr('rel', 'noopener noreferrer')
    		.attr('target', '_blank');
    });
    	
    jQuery(function($)
    {
      $(document).ajaxStop(function()
      {
    	$('a')
    		.filter('[href^="http"], [href^="//"]')
    		.not('[href*="' + window.location.host + '"]')
    		.attr('rel', 'noopener noreferrer')
    		.attr('target', '_blank');  });
    });
    </script>
    Plugin Author WebFactory

    (@webfactory)

    Thank you for sharing the code 👍

    Thread Starter reclaimedpress

    (@reclaimedpress)

    Teamwork makes the dream work! Be well!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Stops working after additional posts loaded on infinte scroll’ is closed to new replies.