No Output For Existing Posts For One Specific CPT

We have a site that is doing something a bit weird - for one CPT (and one only) it’s not showing any output of the existing posts, even for a really simple template like this:

<Loop type=banking_guides>
  <Field title />

If I change the type to any other CPT it works fine.

The CPT name is correct and I’ve added new posts to that CPT and they do show up, so it’s only existing content that just won’t display and I have no idea why. There’s no difference between the old and new content that I can tell.

Is there any reason why this would be happening?

It probably won’t make any difference, but you can try targeting an older post by ID to debug the issue:

<Loop type=banking_guides id=12345>
  <Field title />

Maybe some custom field content on the older posts is causing an issue. I would also try setting an old post to draft and then re-publish to see if that makes any difference.

Ah, so if you add the specific post ID then it does show up. Does that tell you anything about what could be stopping it showing up in a normal loop?

These posts don’t have any custom fields (although they are used as options in a post object field for another CPT).

I’ve tried unpublishing and republishing but it didn’t make a difference.

Well, it seems that L&L can access the older post data but doesn’t think it should be included in a default loop for some reason.

You could try playing with some of the other post loop parameters to find a workaround, such as the publish_date or author parameters. There might be an issue with the default loop for this CPT.

That’s a good shout, thanks. I’ve tried a few things and the bit that got it to work was specifying the authors, eg:

<Loop type=banking_guides author=1,2,3,4,5,6,7>
  <Field title />

Although it also seems to work with this which may be safer:

<Loop type=banking_guides author=*>
  <Field title />

Still not sure exactly what’s going on, but at least it’s functional. Thanks for your help!

1 Like

Sweet, at least it’s working. There’s usually a workaround when L&L is not behaving. :blush:

It’s definitely an odd issue, I think we’d likely need access to the site to figure it out.
If it’s worth it to you for us to take a look you can DM me the details.

@Rips - Appreciate the help, thanks again!

@Tangibleinc - Sure thing, I’ll send you details shortly.