Documentation, Reference Materials and Tutorials for Envira Gallery
With the Deeplinking Addon, you can directly link to a Lightbox view of any image in your gallery. The Envira Gallery plugin automatically generates a URL for your images when you enable deeplinking on your Lightbox galleries. But, is it possible to customize your URL image links?
In this documentation, we’ll walk through how to use a filter to create custom URLs for images in your deeplinked galleries.
This article contains PHP, CSS, and/or JavaScript to customize our plugin. We offer this code as a courtesy but don’t provide support for additional code customizations or 3rd party development.
First, you’ll need to add the following code snippet to your site to create the custom URLs for your deeplinked galleries.
If you need help adding custom code to your site, please check out our guide on adding custom PHP or JavaScript to your site.
/* Customize your URL image links with deeplinking * * @link https://enviragallery.com/docs/how-to-create-custom-urls-for-images-in-deeplinked-galleries/ */ add_filter( 'envira_whitelabel_envira_deeplinking_slug', 'custom_envira_deeplinking_slug' ); add_filter( 'envira_whitelabel', '__return_true' ); function custom_envira_deeplinking_slug( $slug_name ) { // Use your own slug replacing my_custom_slug $custom_slug = 'my_custom_slug'; return $custom_slug; }
After adding the snippet you’ll just need to be sure you replace my_custom_slug with whatever you want to appear in the URL instead.
Now you’re all set to add custom URLs to your Deeplinked galleries!
Envira Gallery: Create, Showcase, and Sell Your Work – Trusted by 150k+ Sites.
Enter the URL of your WordPress website to install
Unlock even more powerful features designed to make your galleries even more beaituful.
Video Galleries
eCommerce
Social media Sharing
Adobe Lightroom
And much more!
Copyright © [#this year :%Y] Envira Gallery, LLC. Envira Gallery is a trademark of Envira Gallery, LLC.