• I have been stumped on this and I am not entirely sure it can be done. I am wanting to combine 2 loops and and “sprinkle” the second loop through out the first loop. Some people do this with ads so they will have an ad show every few posts. What I am attempting to do is add a custom post type(testimony) show up every 3 normal posts. I will try to demonstrate this below.

    post1 post2 post3 testimony1
    post4 post5 post6 testimony2

    I would actually like the testimonys to display randomly but I think having it like this may be easier.

    The problem I am having is the first loops ‘while’ is causing it to loop through the testimonies so they are repeated over and over as long as the main loop has posts. Does anyone know of a way to pull only one nested loop post at a time? I apologize if this sounds confusing if you need any clarification just let me know.

    I have tried nested loops as well as combing both post types in a single loop with no luck.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Nested Loop’ is closed to new replies.