Template inside Kadence theme's archive loop repeats first post in loop

I am using loop & logic template in Kadence theme and i have replaced archive loop with l&l template loop. But first post in archive appears three times. I don’t understand why, may be its a bug.

Update: it returns only one post repeated 10 times on first page of archive instead of 10 different posts.

Hi Zakir,
Sorry for the long wait! Could you send your markup?

I am using following code

<Set mcq_id><Field id /></Set>
<Set mcq_ok><Field opok /></Set>
<a href="{Field url}"><Field title /></a>
<fieldset class="mcqs">
<input type="radio" name="answers[{Get name=mcq_id /}]" id="answer-{Get name=mcq_id /}-1" value="1" required="" class="q_radio">
<input type="radio" name="answers[{Get name=mcq_id /}]" id="answer-{Get name=mcq_id /}-2" value="2" required="" class="q_radio">
<input type="radio" name="answers[{Get name=mcq_id /}]" id="answer-{Get name=mcq_id /}-3" value="3" required="" class="q_radio">
<input type="radio" name="answers[{Get name=mcq_id /}]" id="answer-{Get name=mcq_id /}-4" value="4" required="" class="q_radio">
<div class="reveal-exp">Correct Answer is: <Field name="op_{Get name=mcq_ok}" /><br/>
Explanation: 
<p> <Field exp /> </p> </div> 
</fieldset> 

Here is little more explanation:

I replaced Kadence pro theme’s each archive loop item with Loop and Logic layout with above markdown.

The archive page 1 returned 1 same post 10 times,
Page two returned 10 next different posts each time.

The bug appears to be that on the first page there should be 10 different posts and not 1 post 10 times repeatedly.

I’m not exactly sure what’s causing your issue here, but I do see some potential problems/suggestions/questions you might want to look into. Let me know what you discover based on these and I’ll see if I can help you further.

  1. In your original post in this thread, you mention that you’re working on a post loop for an archive page, but the markup you shared in your March 18 post shows markup that seems to be related to a multiple-choice question with nothing related to a post loop. Where is the loop you mentioned in the original post?
  2. I don’t think this would actually cause any issues for you, but I can see that in some cases when you’ve referenced a tag in an attribute, you’ve added a slash /. In other spots, you haven’t added the slash so I just thought I’d mention that closed tags don’t need the slash / to close themselves inside an attribute. I don’t think the slashes cause issues thought, but I figured I’d note this just in case.
  3. The name parameter of your input tag uses [ ] brackets, which in standard HTML seems fine, but I wonder if this is conflicting either with the processing of the template in PHP or with WordPress’s shortcode functionality. I’m not a developer myself so I’m not sure what the impacts of that could be, but I wonder if omitting brackets from your markup might fix things.

I show blog posts as multiple choice questions therefore my markup is like above.

You can see what I want to achieve Click here

While I have tried simple code without inputs etc. but same issue persists. Anyway now I have switched to other theme. The problem was with kedance only.

Oh ok, so is the issue resolved now that you’ve changed themes or are you still having the problem where your page displays multiple instances of the same post?

Issue hadn’t resolved so I switched to some other theme and used beaver builder instead and got my work done. However if there was any bug which showed same post multiple times, needs to be looked into.

1 Like

Ah ok, understood. I don’t think this was a bug, but there isn’t enough information in this thread to identify where exactly this issue was coming from. Your first post mentions that the issue is with the same post appearing multiple times, which suggests that this is either an issue with an L&L loop or with a PHP loop in your theme. Since the markup you shared doesn’t show a Loop tag, then this points to the fact that the post loop (and therefore the issue) is on the theme’s side, not on L&L’s side. Or at the very least, there’s a misunderstanding of the relationship between the theme and your L&L markup.

In any case, thanks for bringing it to our attention just in case it was a bigger issue. If something like this pops up again, feel free to post about it on here so that we can help out.

1 Like