Support » Fixing WordPress » How to write a single loop (not multiple loops) that prevents duplicate output.

  • I am using a loop to display custom field values in a navigation area. Example: I have 100 posts on the page. Each post has a Brand associated with it (Fender, Gibson, etc.) maybe about 15 brands overall. The navigation loop will output the Brand custom field value for the posts. I want it to only show a brand once, so that instead of outputting 100 Brand values, the loop only outputs 15 unique values, with no duplicates. Everything google shows me about preventing duplicates has to do with wanting a second loop not to duplicate anything from the first loop. This is not my issue – I simply want to prevent duplicate output in a single loop. Any advice? Thank you.

Viewing 1 replies (of 1 total)
  • It is very difficult to help with this problem without being able to see the actual code used. If you put the code in a pastebin and post a link to it here, someone might be able to help.

Viewing 1 replies (of 1 total)
  • The topic ‘How to write a single loop (not multiple loops) that prevents duplicate output.’ is closed to new replies.