Field with image

Home Page – v1.1 Forums Extensions Content Types Field with image

This topic contains 0 replies, has 1 voice, and was last updated by  Thomas Schmidt 4 months, 4 weeks ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #6252

    Thomas Schmidt
    Participant

    I added a field for setup of background image containing an file input.

    get_options_data('background-image', 'field-backgroundimage')

    This is the code suggested in the page but does not return anything. get_options_data() works fine with options pages but does not for custom fields. So I use this workaround:

    get_post_custom()['field-backgroundimage'][0]

    How can I use get_options_data() as expected?

    The returned data is simply an URL to the original file: http://test.local/wp-content/uploads/2017/04/myimage.png What I need is the thumbnail. How can I access the actual file object rather the plain URL?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

Fork us on Github.

Runway on Github

Learn with User Guides.

View the Guides


Thank you for being a part of Runway. We hope you have a great experience and together we can make Runway one of the best additions to the WordPress ecosystem and theme development. We're excited to have you here!

Google+