I have a view that output the content nodes as grid. (instigram style). How to insert an advertisement block in a random location within the views list.
Node Node . . Advertisement . . Node Node
You can override the format specific template like
This module hosted on github https://github.com/pedroposada/custom_views_nthrow seems to do the same more modularly.
If you want to have your custom code after first row then override your default views-view-unformatted.tpl.php with this code:
Step-by-step tutorial for newbies on how to override default views-view-unformatted.tpl.php and achieve custom code after for example first and sixth row is here.