WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I downloaded the PODS 2 plugin (amazing!) - added a field to existing content type and now I would like to print it using php inside a widget. However I am not sure how to print the fields using pods - I tried to initialize it, but it is not working. Please see my code below. Any ideas?

<?php $mypod = pods( 'my_pod' );
 $mypod->display( 'my_field' ); ?>


share|improve this question

display does not echo, so you need to echo it.

<?php echo $mypod->display( 'my_field' ); ?>

More info and examples at http://staging.pods.io/docs/code/pods/display/

Also you will need to specify an ID of the item you want the field from in the pods() call, like:

<?php $mypod = pods( 'my_pod', $id ); ?>

Or use a find() call to get the record you want. http://staging.pods.io/docs/code/pods/find/

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.