• I’m slowly learning php and lost at this point. I’m setting up a site where we have sponsors that we would like to promote. We are using a masonry theme so the idea is to incorporate a sponsor logo every nth post. The logos are currently posted as a status format but unless I change the date every time, they won’t remain in the same positions. I’d like them to automatically show up every nth post.

    I figured this could be done a few ways. Assigning a category “Sponsor” and pulling from that, pulling form the status post format or creating an array of all the sponsors.

    This is the basic loop used and currently what I’ve been trying.

    // Begin loop
                while ( have_posts() ) : the_post();
                $count++;
                get_template_part( 'content', get_post_format() );
                if ( $count%3==0 ) {
    		echo 'first element in array ';
                }
                endwhile; ?>

    I’d like to be able to use the status post format that way others can easily change logos/links/etc without too much difficulty. Is it possible to create a loop that would do this? Post 3 normal posts, then 1 status/”sponsor” post, then 3 more posts, then the next sponsor post, etc?

    Thanks!

The topic ‘Posting Specific Posts within main loop’ is closed to new replies.