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

User Submitted Image Gallery – Part 4

Posted on February 3, 2012 by Pippin in Advanced, Custom Post Types, Member Restricted, Short Codes, Subscriber Only, Taxonomies, Tutorials, Working with Attachments, Working with Users, Writing Plugins 9 Comments
Home» Tutorials » Advanced » User Submitted Image Gallery – Part 4
Tweet
Love It - 0

In part three of this User Submitted Image Gallery plugin tutorial series, we created the function that processes image uploads. Now it is time to build our gallery's short code, which will be used to display the complete gallery of user submitted images. This short code is rather complex and we won't fully finish it for a couple more parts yet, but by the end of this section we will have a fully paginated gallery that shows all of the images.

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
attachments, gallery, images, short code

9 comments on “User Submitted Image Gallery – Part 4”

  1. stansmith says:
    June 17, 2012 at 6:40 pm

    How would I add a image title, description & url link to the thumbnails?

    Reply
    • Pippin says:
      June 18, 2012 at 9:44 am

      Do you want to show the title/description of the “image” custom post type, or the title/description of the attachment file? The thumbnails are already linked to the single page for the image; do you want to link them somewhere else?

  2. David Butler says:
    January 12, 2013 at 7:03 am

    hey Pippin, been scratching my head why the gallery when using the downloaded code was only showing 1 image. Line 84 in shortcodes.php is “‘per_page’ => 1″, I changed this value to 20 and it is looking good (I realise this could have been passed through as a parameter in the shortcode, but thought the default value should be higher).

    My next problem is that my theme is overriding the html width attributes of the image to “auto” in the gallery causing the images to fill up the width of the content box. Would it be better to setup the images dimensions dimensions in the gallery.css to avoid conflict with themes?

    Thirdly is a feature request / improvement idea. It would be nice if you could filter by image year then month (much like the post widget) and the image year is pulled from the EXIF data when uploaded… I am sure this is possible and if I figure it out – will be sure to post a copy.

    The last bit of feedback is that I will be working on allowing posted images to be approved without having to be reviewed, if you are creating a paid version of this – it would be worth considering making this an option.

    I have spent ages looking for plugins to achieve what you have created with this plugin and I am sure that I am not the only willing paying customer! I’m and nothing but a hack, but they way this is written makes it easy for me to understand!

    Thanks!

    Reply
    • David Butler says:
      January 12, 2013 at 7:29 am

      Probably should have tried this before posting. I added the image width and height attributes in the gallery CSS wih success. BUT, I now realise why the theme was applying auto image attributes that is because it is a responsive theme… will look into a solution!

    • Pippin says:
      January 14, 2013 at 9:45 pm

      Yep, responsive themes usually remove those :)

    • Pippin says:
      January 14, 2013 at 9:44 pm

      Filtering images would be really sweet, though I doubt it will make it into a part of the series, sorry. If you’re interested in doing some custom coding on it, I can provide a little guidance.

  3. David Butler says:
    January 13, 2013 at 5:39 am

    hmmm… code did not post correctly, added to snippi: http://snippi.com/s/n89ysj5

    Reply
    • Pippin says:
      January 23, 2013 at 9:24 pm

      You will want to look at the add/remove_query_arg() function. To remove pagination, use remove_query_arg( ‘image-page’)

  4. David Butler says:
    January 19, 2013 at 7:46 am

    Thanks Pippin, got the date filtering added in and it is working well (I am sure it could do with a tidy up from my hacking).

    Here is the modified gallery code: http://snippi.com/s/l10nvyy

    The only thing I am struggling with is filtering after pagination (I don’t think my modifications have introduced this issues). For example, if I am on page 5 of the images and apply a category filter the page parameter stays in the URL and the page displays “No images found.”

    When applying a filter (changing the query) the page should default back to page 1, but I am struggling to find a solution to this. Any ideas?

    Now onto the EXIF data import…

    Reply

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

  • User Submitted Image Gallery – Final Overview
  • User Submitted Image Gallery – Part 8
  • User Submitted Image Gallery – Part 7
  • User Submitted Image Gallery – Part 6
  • Adding a Simple Image Gallery with the Repeatable Upload Field

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
  • Plugin Development 101 – Registering a Custom Post Type
  • Plugin Development 101 – Intro to Actions

Latest Tutorials

  • Test Your Plugins with RTL (0)

    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...

  • Plugin Development 101 – Introduction to Adding Dashboard Menus (1)

    Adding new menus, both top level and sub level, to the WordPress Dashboard is a really common task for plugins...

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

Latest Tweets

  • Anyone bored and feel like showing me how I have failed? https://t.co/uSkvuuN40g
    May 25, 2013
  • @SDavisMedia It&#039;s very minimal on styling, and it&#039;s only the submission forms / dashboard that have styling at all
    May 25, 2013
  • The awesome Frontend Submissions extension was released yesterday for EDD. Create a full-fledged marketplace: https://t.co/WnZXFOsqL8
    May 25, 2013

Topics

wp_enqueue_script Tom McFarlin get_user_meta the_content shortcodes contextual help Sugar Event Calendar featured register_setting meta box attachments add_options_page hook mail chimp Related posts image plugin forms login authors do_action attachment short codes comments recent posts post types apply_filters bbpress short code taxonomies custom post type gallery Ajax images Stripe taxonomy jquery widgets users add_filter add_action easy content types 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