PODS Repeatable Field - cannot change output from comma separated string to separate rows

Hey all,

I’m having a really hard time trying to display values from a repeatable field created in a CPT with PODS as separate line items.

PODS has an option within the repeatable settings to configure how the individual items are outputted:

I’ve tried setting it to Line Breaks and I’ve tried a custom separator of <br>.

I’ve tried using a Rich Text element in Bricks to display this custom field.

No matter what, the custom field always outputs as a comma separated string.

Do you have link or it’s a local site?

I’d prefer not to share as it’s a client site with some client information that’s a WIP unless it’s truly necessary.

Here’s how this section is structured and how it renders:

I don’t fully understand how this is working behind the scenes and if it’s a Bricks issue or a PODS issue because the DB has the post meta content as 2 records. I’m assuming that’s likely normal but I have not used repeater fields until now.

Hi… did you found a solution for this? Interested in using Pods repeatble fields with Bricks

If you need to render any Pods repeater (or even a simple field) inside Bricks Builder (or any page builder that doesn’t execute [pods_repeater_ul]), here’s a clean and reusable PHP shortcode.
It keeps your implementation DRY, works site-wide, and avoids the limitations of native dynamic data tags.


The Code (copy & paste)

You can add this snippet using:

  • Fluent Snippets, or
  • Code Snippets, or
  • a simple functions.php addition in your child theme.
add_shortcode('pods_repeater', function($atts) {
  $atts = shortcode_atts([
    'pod'   => '',              // Pod name (e.g. "tour")
    'field' => '',              // Field slug (e.g. "includes" or "notes")
    'id'    => get_the_ID(),    // Optional: defaults to current post ID
  ], $atts, 'pods_repeater');

  if (empty($atts['pod']) || empty($atts['field'])) {
    return '<!-- Missing pod or field attribute -->';
  }

  $pod = pods($atts['pod'], $atts['id']);
  if (!$pod) {
    return '<!-- Pod not found -->';
  }

  $field_data = $pod->field($atts['field']);
  if (empty($field_data)) {
    return '<!-- Field empty -->';
  }

  // If it's a repeater (array of rows)
  if (is_array($field_data)) {
    $output = '<ul class="pods-list pods-list--' . esc_attr($atts['field']) . '">';
    foreach ($field_data as $row) {
      // Try to extract a readable value (adjust according to your repeater structure)
      if (is_array($row)) {
        $value = $row['title'] ?? $row['name'] ?? $row['item'] ?? reset($row);
      } else {
        $value = $row;
      }
      $output .= '<li>' . esc_html($value) . '</li>';
    }
    $output .= '</ul>';
    return $output;
  }

  // Otherwise, assume it's a simple text field
  return '<ul class="pods-list pods-list--single"><li>' . esc_html($field_data) . '</li></ul>';
});

How to Use

In Bricks Builder (or anywhere shortcodes are supported):

[pods_repeater pod="tour" field="includes"]

For a single text field:

[pods_repeater pod="tour" field="notes"]

Or inside a Bricks Code element:

echo do_shortcode('[pods_repeater pod="tour" field="includes"]');

Tips

  • Output is always an unordered list <ul><li>…</li></ul>.
    You can easily modify it to use <ol>, <div>, or custom markup.

  • Works with any Pod type (CPT-based or standalone).

  • Safe output via esc_html() to prevent injection.

  • If using WPML or Polylang, wrap the ID like this:

    'id' => apply_filters('wpml_object_id', get_the_ID(), $atts['pod']),
    

Why not [pods_repeater_ul]?

Because Bricks Builder doesn’t execute Pods shortcodes by default in dynamic fields or text elements.
This method guarantees server-side rendering of repeaters and works in any context — template, block, or builder.

Hello.
I have the same problem.
Thank you for the code, but I can’t make it work. I don’t understand what it needs in this:
ul class="pods-list pods-list–’ . esc_attr($atts[‘field’])
what class? how to set it? where?
Just as with the first person to ask this question, I don’t have any “li” or class elements or any structure. The output comes our as p, and in one line, with a comma.

Please explain more in detail how to make it work.

Thank you.

OK, I managed to tailor it to myself with the help of ChatGPT.
(Rather proud of myself of thinking to do that, as I never did that before) Wonders never cease…

Thank you for the code!