Home>Support>Vantage theme breaks Polaroid Gallery Plugin found modification to gallery.php fix

Vantage theme breaks Polaroid Gallery Plugin found modification to gallery.php fix

By Netwink, 8 years ago. Last reply by Alex S, 8 years ago.

I had posted this problem previously.

I am experiencing the same problem as many other people where when adding a gallery plugin it does not work in the Vantage Theme.

I have the Vantage premium theme and every gallery app I try to use is broken with the Vantage theme. I works fine with the WordPress default themes Twenty-fifteen etc. but as soon as you apply the Vantage theme the plugin no longer works.

Amazingly it works fine with Page Builder. I tested with the combination of Twenty-fifteen and Page builder and the plugin works like a charm. As soon as I change the theme to Vantage it breaks the gallery and also breaks Robo gallery as well as other gallery plugins.
______________________________________________________________________________________________________
I found the solution that works to be the following change to gallery.php

The offending line in vantage is the first line in the function that vantage registers for the post_gallery hook:

function vantage_gallery($contents, $attr){
if(empty($attr[‘type’]) || $attr[‘type’] != ‘slider’) return;

The issue is that if another function (like mine) is attached to the hook at an earlier priority has created some gallery content, it is thrown out by the vantage function returning an empty string. This can be fixed by changing it to:

function vantage_gallery($contents, $attr){
if(empty($attr[‘type’]) || $attr[‘type’] != ‘slider’) return $contents;

I added the $contents to the line and the Polaroid Gallery plugin works perfectly. It would be great if you could include this modification in future updates of the theme so I don’t have to make this custom change in the future.

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 8 years, 4 months ago Alex S
    Hi, I Work Here

    Hi Netwink,

    I’m slightly confused as galleries that use the default WordPress gallery shortcode not working isn’t a widespread problem with Vantage (or it would have been fixed already) (I actually recommend those galleries over other galleries :S). Regardless, your suggested fix does make sense. I’m going to log this a bug with your solution attached so that it can be added to the next version.

    By the way, as you’re a Vantage Premium user, you’re entitled to priority email support (which is much, much faster). If you would like to make use of that, please follow the instructions found on this page. Please reference this thread.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More