Site logo

Archived topic

Insert ads into archive?

3 replies · Started by Kip on January 25, 2022

Viewing posts 1–4 of 4

Currently, we're using a plugin to insert an ad after every x posts in an archive, but I'm wondering if I could bypass the plugin and just do this through GeneratePress Elements?
Some generic code would be something like:

<?php while (have_posts()) : the_post(); $the_post_ids = get_the_ID(); $i ++?>
<?php if ($i == 5) : ?>
     <div class="ad">
	ad
     </div>
<?php endif; ?>

Is this possible? The plugin we're using is quite heavy for what we're using it for, just looking to streamline

Hi there,

Unfortunately this isn't something elements can do.

The plugin is still the best solution I'm aware of :)

Appreciate it, I didn't think so, but thought I would ask.

No problem :)

This archived topic is closed to new replies.