Pippins Plugins
  • Email
  • Facebook
  • Feedburner
  • Github
  • Google
  • Twitter
  • Vimeo
  • Youtube
  • Rss
  • About
  • News
  • Join the Site
    • Member Benefits
    • Member Plugins
    • Email Notifications
  • Plugin Store
    • Affiliate Area
    • Checkout
  • Plugins
    • Plugin Portfolio
      • Plugin Portfolio – List View
    • Free
    • Premium
    • Member Plugins
    • Coding Standards
    • Get Plugin Support
  • Tutorials
    • Series
      • Plugin Development 101
      • Creating a User Follow System Plugin
      • Customizing Restrict Content Pro
      • Displaying Content with Easy Content Types
      • Writing Your First WordPress Plugins, Basic to Advanced
      • Working with Widgets
      • User Submitted Image Galleries
      • Plugin Thoughts
      • Integrating Stripe.com with WordPress
      • WordPress Rewrite API
    • Member Exclusive
      • Free Members
      • Subscriber Only
    • Difficulty
      • Beginner
      • Intermediate
      • Advanced
    • Action and Filter Hooks
    • Ajax
    • Custom Post Types
    • External APIs
    • Short Codes
    • Taxonomies
    • Video Tutorials
    • Widget Tutorials
    • WordPress Admin / Dashboard
    • Working with jQuery
    • WordPress Database
    • Writing Plugins
    • Tag Index
  • Reviews
  • Support Forum
  • Contact
    • Support the Site
    • Request Code Review
    • Plugin Support

Adding a Simple Image Gallery with the Repeatable Upload Field

Posted on February 8, 2012 by Pippin in Custom Post Types, Member Restricted, Subscriber Only, Tutorials, Video Tutorials, Working with Attachments 17 Comments
Home» Tutorials » Custom Post Types » Adding a Simple Image Gallery with the Repeatable Upload Field
Tweet
Love It - 0

The new repeatable upload field in Easy Content Types, which was announced yesterday, provides a really easy to use method for creating simple image galleries. We are going to build off of the end result of the Creating a Simple Events System with Easy Content Types and add a minimal, but effective, image gallery to our Event detail page.

You must be logged in and have an active premium membership to view the rest of this content. Register or login from the sidebar.

Tweet Follow @pippinsplugins
easy content types, gallery, images

17 comments on “Adding a Simple Image Gallery with the Repeatable Upload Field”

  1. banunn says:
    February 26, 2012 at 6:06 pm

    Hey Pippin! Thanks for the great tutorial.

    Is it possible to create a lightbox gallery using the repeatable fields.. such as

    <a href="ID, 'ecpt_addimage', true); ?>" rel="lightbox" ><img src="/timthumb/timthumb.php?src=ID, 'ecpt_addimage', true);?>&h=100&w=200&zc=1" class="project-image"/>

    Reply
    • Pippin says:
      February 27, 2012 at 8:45 am

      It looks like your code formatting got messed up a little, but absolutely yes! The only thing you would need to change is that instead of echoing out the get_post_meta() for each image, you need to loop though the post meta and display each key from the array, since the meta for the repeatable fields is stored as an array. Make sense?

  2. Brock Nunn says:
    February 27, 2012 at 5:15 pm

    I think I understand what you are talking about. Is there any way I could talk you into giving a short code example, I couldn’t find that exact method in the help section.

    Sorry for all of the trouble with this one. I am trying to develop a theme “Helper” plugin wherein I can have images repeat uploaded and output as a slimbox grid gallery.

    Reply
    • Pippin says:
      February 27, 2012 at 5:39 pm

      Here’s an example: http://pastebin.com/6xji2gvX

  3. Brock Nunn says:
    February 27, 2012 at 7:04 pm

    You sir are a saint and a scholar! But seriously, thank you. I really appreciate you taking the time to lend a hand.

    Reply
  4. willzemberg says:
    May 30, 2012 at 5:59 am

    Hello, good morning everyone.
    Does anyone know when you have the image tag ID, ‘ecpt_fotos’, true);

    Do not have image loading other standard image?

    Reply
  5. richard carpenter says:
    January 13, 2013 at 12:36 pm

    Hi Pippin,

    I am trying to use the repeatable upload field for a gallery, here’s my scenario,

    On the gallery page i have a normal grid style gallery. I would also like to add a lightbox when the image is clicked.

    Then,

    on my homepage i have 4 thumbnail blocks “Latest from the gallery” Is it possible to pull the latest 4 images from the gallery onto the homepage?

    I am not using custom post types part of the plugin. Just the meta box part. I am using just the pages using custom template for each page.

    I will be using shadowbox for my light box so just need to be able to add “rel=shadowbox” to the anchor tag


    Thanks for your help

    Reply
    • Pippin says:
      January 14, 2013 at 11:38 am

      Pulling just the first 4 images is pretty simple. Can you show me your current code?

  6. richard carpenter says:
    January 14, 2013 at 12:57 pm

    I have no code at the moment other than the page code itself, as i don’t know a lot of php.

    http://pastebin.com/mxdYi7yX

    Ideally i would like to output the repeatable fields like this (Nothing special)

    http://pastebin.com/n7fHnsgQ

    Then be able to loop through the latest 4 on the homepage in a similar style list.

    Im currently using wordpress as a CMS for a client, and having this repeatable upload for the gallery is so much better than the default wp gallery.

    Many thanks for your help.

    Reply
    • Pippin says:
      January 14, 2013 at 10:03 pm

      Richard, could you repost this in the support ticket you opened? It’ll be easiest for me to help you there.

  7. richard carpenter says:
    January 15, 2013 at 4:09 am

    Ok will do. Thanks

    Reply
  8. richard carpenter says:
    January 16, 2013 at 1:15 pm

    http://support.pippinsplugins.com/forums/topic/repeatable-image-upload-on-page/

    still waiting for a reply on this. Don’t mean to push my luck but if you could help me with this it would be much appreciated

    Reply
    • Pippin says:
      January 21, 2013 at 4:47 pm

      Sorry for the delay, the ticket was answered yesterday.

  9. Mikee88 says:
    February 18, 2013 at 11:36 pm

    Hi Pippin,

    I want to use the code you posted here for repeatable image uploads: http://pastebin.com/6xji2gvX, but I want to include a repeatable text field as well that will be the caption for each image. I get the general idea of creating the variable for the caption field & including it, but can’t seem to get the details right so if you could help in any way that would be great. Thanks!

    Mike

    Reply
    • Mikee88 says:
      February 19, 2013 at 1:39 pm

      I solved this today by adding a count. There is another problem I’m having though now. I don’t want an image placeholder to show up if nothing is put in the repeatable upload field. However, I’ve tried if statements I’d normally use for regular fields & they’re not working for repeatable upload fields. It’s like even when there is nothing in the repeatable field, it still is showing there is something. Any idea how to recognize there is nothing in the repeatable upload field & return a blank. Thanks again,

      Mike

    • Pippin says:
      February 19, 2013 at 2:23 pm

      Try:

      if( ! empty( $field_value ) )
    • mikee88 says:
      February 19, 2013 at 2:58 pm

      That works, thanks!

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • Login

Lost your password?

Please enter your username or e-mail address. You will receive a new password via e-mail.

  • Facebook Become a Fan Like

  • Twitter Subscribe on Twitter Follow

  • YouTube Follow my Videos Subscribe

  • RSS Feed Subscribe with RSS Subscribe

Easy Digital Downloads

Most Loved

  • Love It Pro for WordPress
  • Write a “Love It” Plugin with Ajax to Let Users Love Their Favorite Posts / Pages
  • Simple Notices Pro Plugin for WordPress
  • User Bookmarks for WordPress
  • Front End Registration and Login Forms Plugin

Similar Plugins and Posts

  • Jobs Posting with Easy Content Types and Gravity Forms
  • User Submitted Image Gallery – Final Overview
  • User Submitted Image Gallery – Part 8
  • User Submitted Image Gallery – Part 7
  • User Submitted Image Gallery – Part 6

Latest Premium Content

  • Plugin Development 101 – Introduction to Adding Dashboard Menus
  • Plugin Development 101 – Intro to Loading Scripts and Styles
  • User Follow System – Part 5
  • Plugin Development 101 – Intro to Short Codes

Latest Tutorials

  • Storing Session Data in WordPress without $_SESSION (19)

    The term Session in web development refers to...

  • Test Your Plugins with RTL (1)

    Right-To-Left languages are those that...

  • Submitting Your First Pull Request to a WordPress Plugin on Github (5)

    Github is an extremely popular tool for managing WordPress plugins, and one...

Enter your email to receive automated updates when new posts are published

WP Core Contributions

  • [24316]

View the ticket on Trac.

WP Codex Contributions

  • Function: shortcode exists
  • Function: has shortcode
  • Function: shortcode exists
  • Function: shortcode exists
  • Function: has shortcode

View all 41 changes in the Codex.

Latest Tweets

  • Could not fetch Twitter RSS feed.

Topics

contextual help featured register_setting shortcodes attachments add_options_page Tom McFarlin get_user_meta hook add_shortcode meta box Sugar Event Calendar wp_enqueue_script forms short codes plugin do_action login Related posts authors mail chimp attachment image recent posts post types apply_filters comments short code bbpress taxonomies custom post type Ajax gallery images Stripe taxonomy jquery widgets users add_filter easy content types add_action widget restrict content pro easy digital downloads

Weekly Newsletter

Useful Links

  • Join the Site
  • Plugin Store
  • Affiliate Area
  • Tag Index
  • Support the Site
  • Suggest a Tutorial
  • Random Post
  • Contact

Monthly Archives

(c) 2013 Pippin's Plugins