Documentation, Reference Materials and Tutorials for Envira Gallery
How to change the Envira breadcrumbs URL
Do you have Breadcrumbs enabled inside of Envira Gallery, and would you like to change the URL of the homepage?
This tutorial will walk you through how to change the default homepage URL to a custom URL for Envira Breadcrumbs with some code tweaks.
Heads up!
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.
Adding the code snippet
To change the default Homepage URL to a different URL, you’ll need to add the following code.
/* Change the Homepage URL inside Envira Breadcrumbs
*
* @link https://enviragallery.com/docs/how-to-change-the-homepage-url-inside-envira-breadcrumbs/
*/
add_filter( 'envira_breadcrumbs_data', 'test_envira_breadcrumbs_data', 10, 5 );
function test_envira_breadcrumbs_data( $breadcrumbs, $album_id, $gallery_id, $separator, $album_post_id ) {
//Change the title and url to your own
$breadcrumbs[0]['title'] = 'Your Title Here';
$breadcrumbs[0]['url'] = 'http://www.customurl.com';
return $breadcrumbs;
}
Customizing the snippet
The following code is set to change the default homepage URL to https://www.enviragallery.com. On lines 8 and 9 below, you will need to add your own custom title and URL.
After adding the code, you will see the homepage URL changed to the URL that was added inside the code.