• Anonymous User 17818406

    (@anonymized-17818406)


    Hi,

    When we view a post with an embedded gallery, if the post is initially hidden (display: none), the gallery does not load the pictures, you can only see the arrows and an empty space between them.

    This error does not happen if:

    A. Opening the Developer Tools (for example Chrome’s).
    B. Clicking on an arrow (this way, the first image you see is number two, and then you can go back to see image number one, which now is loaded correctly)

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Mihai Ceban

    (@mihaiimagely)

    Hi @fabuky,

    In similar cases, the first thing that we are suggesting is to test for a plugin conflict:

    • Temporarily deactivate all your plugins except NextGen Gallery
    • Is the problem solved? Then, it was caused by one of your plugins. Please check one by one and find the one causing the problem.
    • If the problem is not solved with the deactivation of the plugins, try changing to a standard WordPress theme, it could be a conflict with your current theme.

    Note: We recommend performing a full website backup before any troubleshooting.

    Thread Starter Anonymous User 17818406

    (@anonymized-17818406)

    Hi,

    We are testing on an empty wordpress site, theme used twenty twenty, but also happens with other themes.

    No other plugins activated, just yours.

    You can check it here:

    https://www.imaginauta.com/2020/10/ (press the red button “Mostrar post”, then you will see only the arrows until you click on one of the arrows).

    Thanks!

    Hi @fabuky,

    Apologies, it might be the case that the shortcode is not correctly rendered.

    Is this particular Archive page custom made by any case?

    Please, keep us posted. We are happy to help!

    Thread Starter Anonymous User 17818406

    (@anonymized-17818406)

    Hi,

    Really, it is not important if it is the archive page or another one. We are testing now in the home page. What we have modified (just a little) is the “content.php” default template of the Twenty Sixteen theme.

    1. Go to https://www.imaginauta.com/
    2. Press “Show post” button
    3. You will see that the first image is not showing, only the arrows
    4. Press one arrow and the images will show

    Our changes in the “content.php” file are the following:

    1. Article tag, the style atribute.
    2. Button tag (at the bottom)

    <?php
    /**
    * The template part for displaying content
    *
    * @package WordPress
    * @subpackage Twenty_Sixteen
    * @since Twenty Sixteen 1.0
    */
    ?>

    <article id=”post-<?php the_ID(); ?>” <?php post_class(); ?> style=”display: none;”>
    <header class=”entry-header”>
    <?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>
    <span class=”sticky-post”><?php _e( ‘Featured’, ‘twentysixteen’ ); ?></span>
    <?php endif; ?>

    <?php the_title( sprintf( ‘<h2 class=”entry-title”>‘, esc_url( get_permalink() ) ), ‘</h2>’ ); ?>
    </header><!– .entry-header –>

    <?php twentysixteen_excerpt(); ?>

    <?php twentysixteen_post_thumbnail(); ?>

    <div class=”entry-content”>
    <?php
    the_content(
    sprintf(
    /* translators: %s: Post title. */
    __( ‘Continue reading<span class=”screen-reader-text”> “%s”</span>’, ‘twentysixteen’ ),
    get_the_title()
    )
    );

    wp_link_pages(
    array(
    ‘before’ => ‘<div class=”page-links”><span class=”page-links-title”>’ . __( ‘Pages:’, ‘twentysixteen’ ) . ‘</span>’,
    ‘after’ => ‘</div>’,
    ‘link_before’ => ‘<span>’,
    ‘link_after’ => ‘</span>’,
    ‘pagelink’ => ‘<span class=”screen-reader-text”>’ . __( ‘Page’, ‘twentysixteen’ ) . ‘ </span>%’,
    ‘separator’ => ‘<span class=”screen-reader-text”>, </span>’,
    )
    );
    ?>
    </div><!– .entry-content –>

    <footer class=”entry-footer”>
    <?php twentysixteen_entry_meta(); ?>
    <?php
    edit_post_link(
    sprintf(
    /* translators: %s: Post title. */
    __( ‘Edit<span class=”screen-reader-text”> “%s”</span>’, ‘twentysixteen’ ),
    get_the_title()
    ),
    ‘<span class=”edit-link”>’,
    ‘</span>’
    );
    ?>
    </footer><!– .entry-footer –>
    </article><!– #post-<?php the_ID(); ?> –>

    <button type=”button” onclick=”document.getElementById(‘post-<?php the_ID(); ?>’).style.display = ‘block'”>Show post</button>

    Hello @fabuky,

    Yes, but is a custom code on the way the archive or a regular page works with the default WordPress Theme. Apologies, but this is out of our support scope.

    Thread Starter Anonymous User 17818406

    (@anonymized-17818406)

    Hi,

    No, this is no “custom” code, this is the default code from WordPress which anybody can use. We’re just hiding the post that includes the gallery (with a normal “display:none”) and showing it after DOM is loaded (with a button, as in our case, or just removing the style with Chrome Developer Tools).

    We think that maybe you could make this to work in your plugin. It is a feature that it would help other users too.

    Thanks

    Thread Starter Anonymous User 17818406

    (@anonymized-17818406)

    Just to try, we have changed the display mode of the gallery (from Basic Slideshow, which does not show the image, to Basic Thumbnail) and now the images are showing.

    So it looks like you have a bug in the plugin with Basic Slideshow, as the gallery should work in any types of presentation.

    You can check it in the same url: https://www.imaginauta.com/ (press button “show post”). Now, with Basic Thumbnails display, you can see the images.

    Thank you!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Gallery error in post initially hidden’ is closed to new replies.