Fill a WordPress gallery with Unsplash photos by search term, photographer or collection. They load from Unsplash with credits, and nothing is stored.
Where these photos come from
Nothing in the gallery above was uploaded. The block asks Unsplash for photos that match a search term, a photographer or a collection, and prints whatever comes back. Each photo keeps its description and its date, and the author line credits the photographer as “By Name on Unsplash”, linked with Unsplash’s attribution parameters. The files are served from Unsplash’s CDN at the sizes set in Settings, Images.
The alternative is to download stock photos by hand, upload them to the Media Library and build a normal image gallery. That works for twelve photos you chose once. It stops working when the page has to stay current, or when you would rather not host other people’s photos. Unsplash is the only source in the plugin that stores nothing on your server. Set Max Photos to 200 and your uploads folder stays the size it was.
Fields on the Unsplash account form
One connected account holds one query. Most of the fields below apply only when Source by is set to Search Photos. The full table is in the Unsplash feed documentation.
- Source by takes Search Photos (the default), Search Collections, User Photos, User Collections or Collection ID.
- Search Terms is free text, read by Search Photos and Search Collections only.
- Orientation takes Landscape, Portrait or Squarish on Search Photos. Left alone, any orientation comes back.
- Order By is Relevant or Latest on Search Photos, and Relevant is the default.
- Username feeds User Photos and User Collections, Collection Id feeds Collection ID.
- Max Photos runs from 1 to 200 and defaults to 30, fetched thirty per request.
- In the block, Order by takes Date or Title, Order Direction defaults to DESC, and the Filter element has nothing to list for social items.
Connecting Unsplash and placing the block
- Open Settings, then Social Feeds, then the Unsplash tab. Click + Connect and then Get Access Token. Log in to Unsplash in the popup and authorize the app, and the token fields fill themselves.
- Give the account a Name, pick Source by, fill Search Terms, Username or Collection Id to match it, and set Max Photos. Save Changes starts the import of a new account immediately.
- Add the gallery block to a page, set the content source to Social, choose Unsplash and your account, then set the layout to Masonry and the pagination Type to Infinite. Outside the block editor, a Saved Layout is what a page builder places.
What the Pro license buys here
The masonry layout, the Fade skin, the author line and Infinite pagination all work in the free plugin, on images you upload yourself. Pro is what puts Unsplash behind them. That means the Social content source in the block, the Unsplash tab in Settings and the login popup that fetches the token. The same line covers the other social feed sources. The item by item split is in the free versus Pro comparison, and the license tiers are on the pricing page. Four smaller things here are Pro too.
- Image transform, the scale(1.05) these thumbnails carry on the Fade skin.
- Threshold Distance, 10 to 800 px and 400 by default, which sets how early the next page starts loading.
- Display Load More every page load, which pauses the automatic loading every few pages, five by default, and shows the button.
- Responsive Breakpoints in Settings, General. A three column masonry drops to two at 768 px and one at 576 px until you move them.
What people ask before connecting Unsplash
How often do new photos appear?
The Unsplash list is refreshed every three hours by WP-Cron, which only runs when somebody visits the site. On a quiet site the refresh waits for the next visitor. Point a real cron job at wp-cron.php every five minutes and the timing holds. The rest of the schedule is in the note on how often social feeds update.
Are the photos copied to my server?
Not the Unsplash ones. Instagram, YouTube, Flickr and the rest download their media into wp-content/uploads/visual-portfolio-pro/ and register it in the Media Library under the Social filter. Unsplash photos are hot-linked instead, with the attribution Unsplash asks for. The one line version is under where social images are stored.
Can I edit an imported photo?
An Unsplash photo, no. Posts from the other networks arrive as Social Items under the Visual Portfolio menu, where the title, the content, the image and the links can be edited. A sync only adds new posts, so those edits survive it, as editing imported social posts explains. Unsplash photos never become Social Items, so the description and the credit read as Unsplash has them.