Using jQuery .after inside loop

WordPress requires no-conflict for jQuery.

Change this:

var tiles = $('#article-tile:nth-child('+adLoc+')');
$(tiles).after(adTile);

…to this:

var tiles = jQuery('#article-tile:nth-child('+adLoc+')');
jQuery(tiles).after(adTile);

Or else wrap your entire script accordingly:

jQuery(document).ready(function($) {
    // $() will work as an alias for jQuery() inside of this function
});