WordPress.org

Forums

Just Custom Fields
[resolved] How can I get 'upload media' content! (2 posts)

  1. juanag
    Member
    Posted 3 years ago #

    Hi!

    I'm using this plugin, and I added a "upload media" custom field. My question is, how can i get the content of this custom field in my template?

    My custom field is called 'slideshow-inicio', and i try to get it with this code: <?php echo get_post_meta($post->ID, 'slideshow-inicio', true); ?

    But it not works :((

    http://wordpress.org/extend/plugins/just-custom-fields/

  2. Alexander Prokopenko
    Member
    Plugin Author

    Posted 3 years ago #

    Hi
    All values are saved as usual post meta data. So you can get them with function
    $images = get_post_meta($post->ID, 'slide_images', true);
    where 'slide_images' - is slug name of your upload media field.

    $images variable will have the multiple Array inside, which should be similar to this:

    array(
       [(int)image_number] => array(
              [image] => real_image_source
              [title] => value // optional
              [description] => value // optional
          )
    )

    Hope this helps. You can also read more info on our official plugin page:

    http://justcoded.com/just-labs/just-custom-fields-for-wordpress-plugin

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Just Custom Fields
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic