Skip to content

Instantly share code, notes, and snippets.

@alexschreyer
Created May 22, 2020 14:25
Show Gist options
  • Save alexschreyer/5fc81a5dce2e6565b810260ffeb97199 to your computer and use it in GitHub Desktop.
Save alexschreyer/5fc81a5dce2e6565b810260ffeb97199 to your computer and use it in GitHub Desktop.
Creating better in-text ads with jQuery
// Create an in-text ad for long texts by MOVING with jQuery
jQuery('.ad').first().insertAfter('.entry-content > p:nth-of-type(4)');
// Create an in-text ad for long texts by COPYING with jQuery
jQuery('.ad').first().clone().insertAfter('.entry-content > p:nth-of-type(4)');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment