Support » Plugin: Pods - Custom Content Types and Fields » Return image or image path of image stored in Settings

  • Resolved Archie22is

    (@archie22is)


    Hi guys,

    I know how to return text stored in Settings by using:
    <?php echo get_option( 'settings_name_value' ); ?>

    However, when i use the same to return an image I get an error. When I do a var_dump of the value I wish to return it give me: array(1) { [0]=> int(113) }

    Does anyone know how I can return the image path?

    https://wordpress.org/plugins/pods/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Josh Pollock

    (@shelob9)

    You can pass that ID for the image to any WordPress image function to get the source.

    Hi Josh,

    I am not entirely sure I understand. You mean the id that is visible from the WordPress Options table?

    Plugin Contributor Josh Pollock

    (@shelob9)

    I’m note sure I understand what you are asking. Why do you have an image’s ID in the options table, and how does this discussion relate to Pods? No Pods data is stored in the options table.

    Hi Josh,

    I am sorry to sound stupid. I have created a Custom Settings Page using Pods and it has several image fields.

    My question was how to I retrieve the field image url?

    In my Options table in the database I have the fields from the custom Settings Page created with pods; however I cannot get any of the image fields urls?

    My second question was: Do I use the field IDs from the Options table? ( I tried that already and didn’t work. Ignore the question, it was very silly of me).

    So only any help with question 1 will be appreciated 🙂

    Plugin Contributor Josh Pollock

    (@shelob9)

    You use the Pods class for a custom settings page, just like with any other table-based Pod. Once you have the ID for an image, use it with any WordPress image function to get source, attachment page, dimensions, meta data, etc.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Return image or image path of image stored in Settings’ is closed to new replies.