• Resolved mheumann

    (@mheumann)


    Hi,

    I am not posting the URL of our site because we have already solved the problem by patching the plugin code. See below.

    Problem description:
    We have a bilingual website in German and Spanish (www.dsvalpo.cl) which has a gallery page where we keep adding short codes to each new gallery, for example:

    [print_gllr id=27945 display=short]
    [print_gllr id=27895 display=short]
    [print_gllr id=27884 display=short]

    This generates a page with a picture and title of each gallery and a link that should take to the gallery.

    This works fine on the Spanish version of the site, where each link leads to the corresponding gallery, for example https://www.dsvalpo.cl/gallery/winterfest-oberstufe/.

    In the German version of the site, though, after every update of the Gallery plugin, clicking on any of the gallery links on https://www.dsvalpo.cl/de/galeria-de-fotos/ leads always to the same gallery, the last one posted. The links displayed in the browser are correct, only the gallery displayed is not the one corresponding to that link. These links include the language identifier (de): https://www.dsvalpo.cl/de/gallery/fussball-dsv/.

    We have been having this problem for years and usually patched the template file. But the corresponding code has now been moved inside the plugin, but it is still the same issue.

    We fix this now by making the following code change:

    Correct the file /wp-content/plugins/gallery_plugin/gallery-plugin.php, in function gllr_single_template_content()

    Change

    
                    $args = array(
                        'post_type'                => 'gallery',
                        'post_status'            => 'publish',
                        'name'                    => $wp_query->query_vars['name'],
                        'posts_per_page'        => 1,
                    );
    

    To

    
                    $args = array(
                        'post_type'                => 'gallery',
                        'post_status'            => 'publish',
                        'name'                    => $wp_query->query_vars['name'],
                        'posts_per_page'        => 1,
                        'p'                        => $wp_query->query_vars['p'],
                    );
    

    We add the last line (array element p).

    We use WPML for the translation of the site.

    We have contacted you about this years ago but were told you couldn’t reproduce the problem. If this is still the case, would it be possible to consider this change anyway since it surely won’t harm anyone?

    Thanks!

Viewing 1 replies (of 1 total)
  • Plugin Author bestwebsoft

    (@bestwebsoft)

    Hi,

    Thank you for contacting us!

    Thank you for your kind suggestion. We will consider it, and if we deem it necessary, we will make the necessary changes to the plugin.

Viewing 1 replies (of 1 total)
  • The topic ‘When using localized URLs, last gallery is always displayed for all shortcodes’ is closed to new replies.