• Resolved dmkjr

    (@dmkjr)


    Hello community! It’s been some time since we’ve used PODS and I’m having a difficult time remembering how to display custom_fields. When using ACF, you can edit a theme template page “single-staff.php” for the “staff” custom post type and the snippet would be something like <?php the_field(‘elected_position’) ?>

    How does this work with PODS? I’m trying to display a custom_field of @email_address for everything that renders the template “single-staff.php”.

    I know this cannot be difficult, but I’m over thinking it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @dmkjr

    There are many ways: https://docs.pods.io/displaying-pods/

    We even included the same functions as ACF so you should also be able to use get_field etc.
    Alternatively we have our own: https://docs.pods.io/code/field-functions/

    Cheers, Jory

    Thread Starter dmkjr

    (@dmkjr)

    @keraweb would is work as in <?php get_field('elected_position') ?> ?

    I’m doing this inside my single-staff.php template. I’ve referenced the document, and maybe I’m just thinking too far into this. ACF doesn’t require me to add anything to the loop, is that what I’m missing, I need to do something with the PODS loop?

    • This reply was modified 2 years, 9 months ago by dmkjr.
    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @dmkjr

    Yes, but you shouldn’t forget the echo command otherwise it won’t output anything:
    <?php echo get_field('elected_position') ?>

    What do you mean with “ACF doesn’t require me to add anything to the loop”?
    Are you currently using a Pods loop or a WordPress loop?

    All ACF related examples are of course meant for the WordPress loop.
    The Pods loop would be different since you would be working with Pods objects.

    Cheers, Jory

    Thread Starter dmkjr

    (@dmkjr)

    @keraweb Currently the template is just the wordpress loop. What do I need to do to add the PODS loop to the template as well? I tried to follow the documentation, but it wasn’t very clear to me. Perhaps not clear because I’m not used to working with another loop outside of the WP loop.

    Thanks!

    Plugin Author Jory Hogeveen

    (@keraweb)

    Please read my comment ??
    In it I state that since you use the default WordPress loop you can use the ACF-alike get_field() functions if you want. No need to convert the loop type.

    Cheers, Jory

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Display POD Fields within WordPress Template’ is closed to new replies.