Envira Gallery Documentation

Documentation, Reference Materials and Tutorials for Envira Gallery

How to Change the Homepage URL inside Envira Breadcrumbs

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.

This tutorial is a bit more technical than our other docs, but we’ll walk you through the process step by step. In order to change the text, we’ll need to create and upload a basic WordPress plugin.


Creating the Plugin

To change the default Homepage URL to a different URL, just add the following code to a new file at wp-content/plugins/envira-gallery-change-breadcrumb-home-url.php.

This following code is set to change the default homepage URL to https://www.enviragallery.com. On line 13 and 14 below, you will need to add your own custom title and URL.
<?php 
/**
* Plugin Name: Envira Gallery - Change Breadcrumbs Homepage URL
* Plugin URI: https://enviragallery.com
* Version: 1.0
* Author: Envira Gallery Team
* Author URI: https://enviragallery.com
* Description: This will allow you to change the default Homepage URL to a URL of your choice
*/
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 ) {
    $breadcrumbs[0]['title'] = 'Envira Gallery Homepage';
    $breadcrumbs[0]['url'] = 'http://www.enviragallery.com';
    return $breadcrumbs;
}

If you’re unsure how to create a plugin file, follow these steps below:

  1. Open a text file and make sure that it is a plain text document. You can use a plain text editor like Notepad or a code editor of your choice.
  2. Next, copy and paste the code shown above into the file and save the file as envira-gallery-change-breadcrumb-home-url.php.
  3. Once you’ve saved the file you can easily upload this directly to your /plugins directory on your server using FTP or you can right-click on the text document and zip (or compress).
  4. Finally, log in to your WordPress dashboard and go to Plugins » Add New » Upload Plugin and upload the .zip file you just created in the previous step.

Activate the Plugin

Your next step is to activate the plugin you just uploaded. Simply navigate to the Plugins from within your WordPress dashboard and activate the Envira Gallery – Change Breadcrumbs Homepage URL plugin.

After activating, you will see the homepage URL changed to the URL that was added inside of the plugin.

That’s it! Would you like to extend Envira further? Check out our tutorial on how to How to change the Image Counter Image text inside of the Envira Gallery Image Counter.


FAQs

Q: Can I apply a different URL for each gallery?

A: At this time, the text and URL entered in this plugin will be applied to all galleries that have Breadcrumbs enabled.