Photos

 

General Notes (🔗)

  • For an overview of the layouts, see the Layouts page.
  • In the sections below, the user_id is the id associated with your Google Account. E.g. If you have an email xyz@gmail.com, your user_id is xyz, or xyz@gmail.com. Note that if you have a Google-hosted domain, i.e. if your email is xyz@my-domain.com and the email at my-domain.com is managed by Google, you cannot use xyz@my-domain.com. This is a limitation with the Google’s API, which doesn’t return non-public photos associated with such accounts.

Google Photos vs. Picasa (🔗)

With the shift from PicasaWeb to Google Photos, Google killed the capability to display all photos in a single shot for unauthorized users. You could, earlier, display photos for a user in Picasa use the following syntax:

 [gallery type='picasa' user_id='xyz' kind='photo'] 

However, now the above will work only if you enable back-end authentication by providing a “Refresh Token” in Photonic → Settings → Picasa → Picasa Options → Refresh Token (for Back-end / Server-side Authentication). See this for details.

Displaying All Photos (🔗)

The following pulls some of my photos. The key parameters here are user_id (set to my user name), kind (set to photo), and max_results (limits it to some instead of all photos):

[gallery type='picasa' user_id='sayontan' kind='photo' layout='random' max_results=30]

Photos from an Album (🔗)

If you want photos from a specific album you can say:

 [gallery type='picasa' user_id='xyz' album='abc'] 

Here are the photos from one of Kokonad’s albums (authkey protected):

Though the above album is authkey protected, I am authorized to see the photos. So I can display them using my “Refresh Token”, without providing the authkey.

You can add further constraints such as the number of photos and the number of photos per row:

 [gallery type='picasa' user_id='xyz' album='abc' max_resuts='m' columns='n'] 

This is one of Kokonad’s albums with max_results=10 and layout='random':

Videos (🔗)

What if you had some videos in the mix? Photonic can handle that too. I have the philosophy that Photonic is meant for photos, not videos, because Photonic’s primary goal is to assist in making photos easily and beautifully presented for photographers using WordPress. In fact most online photo services deprioritize videos with the same philosophy, and some services don’t even have videos! At the time of writing 500px.com doesn’t have videos, and guess what? Native WordPress galleries don’t support videos! That being said, people often use photo services, notably Google Photos, to share personal videos with family, and so, with effect from version 1.66 of Photonic, videos are supported.

Videos are turned off by default for each provider. For Picasa / Google Photos the setting is under Photonic → Settings → Picasa → Picasa Settings → Media to show. Regardless of this setting, you can explicitly pass the media parameter to your shortcode. This parameter takes values photos (to show photos only), videos (to show videos only) and all (to show both photos and videos). I have videos turned off on my website, so I will use the media parameter to show videos from my account:

[gallery type='picasa' user_id='sayontan' album='6354351428035793137' max_results=30 media='all']

The above shows the following:

  • IMG_0101.JPG
  • IMG_0143.JPG
  • MVI_0178.MP4
  • IMG_0186.JPG
  • MVI_0206.MP4
  • DSC_0032.JPG

Note that lightboxes have notoriously flaky support for externally hosted videos. Please refer to the lightboxes page to see which ones can be used.

Videos can be incorporated into any layout.

“Show More” and Paged Results (🔗)

If a search result has a lot of photos and you want to reduce the count, Photonic offers a couple of approaches:

  1. For Picasa, use the max_results attribute documented above, and add an additional tag, more. This will initially show you the number of photos specified in max_results, and a button to load more images. Upon clicking the button you will see an additional set of photos as limited by max_results. The button will continue to show until you have exhausted the entire set of photos.
  2. Photonic can be used in conjunction with <!-- nextpage --> to display photos in a paged manner. For this you can structure your page content thus in the WP Editor:
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc porta enim vel tellus dignissim, a venenatis neque congue. Nunc ornare cursus leo ac viverra. Pellentesque suscipit pulvinar metus, non aliquam odio egestas quis. Vestibulum porta viverra magna, vel malesuada ante fermentum vitae.
    [gallery type='picasa' user_id='kokonad' album='CorningGlassMuseum' max_results=10 layout='random' start_index=1]
    <!-- nextpage -->
    [gallery type='picasa' user_id='kokonad' album='CorningGlassMuseum' max_results=10 layout='random' start_index=11]
    <!-- nextpage -->
    [gallery type='picasa' user_id='kokonad' album='CorningGlassMuseum' max_results=10 layout='random' start_index=21]
    

Here is an example using the first approach. The text you provide to the more parameter controls what is shown in the button:

[gallery type='picasa' user_id='kokonad' album='CorningGlassMuseum' max_results=10 layout='circle' more='Show More']