WordPress Insert ads after every 5th post September 7, 2022 by Tarik Billa You’ll want to use the % math operator. if ( $currentPost % 5 === 0 ){ echo "Ad Space</br>"; }