• Resolved stuartcr

    (@stuartcr)


    Hi there!

    on this page (https://luwihealth.wpenginepowered.com/), i have the lightbox implemented at the bottom, “our clinics” the 12 images below should open into a lightbox, but dont.

    when you click on them they link to a bigger image, just there is no lightbox.

    the gallery is being created using Advanced Custom Fields, so i tried to just add an image using the basic text editor and “add media”, I still just get images that link to a bigger image but still no lightbox.

    this is the second time i have attempted to implement your lightbox solution and failed.

    The “Help” section on your website seems out of date, as the link to wordpress seem broken.

    can you help me at all? im not an amateur, but seem to failing this :(, not sure what i have done wrong?

    The page I need help with: [log in to see the link]

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Archetyped

    (@archetyped)

    Hi, SLB automatically supports image links in post/page content. Are you image links you’re referring to within the page’s actual content, or are they added separate (e.g. via a template block, etc.)?

    Please provide more details on how the links are added to the page. Also, please provide a screenshot of SLB’s admin settings page.

    Thanks.

    Thread Starter stuartcr

    (@stuartcr)

    Hi there!! thank you for your fast response!!

    Im using Advanced Custom Fields to create the gallery.

                            <?php
    $images = get_field('uk_clinic_images', 'option');
    
    if ($images) {
        echo '<div class="luwi-gallery post-per-row-3">';
        foreach ($images as $image) {
            echo '<a href="' . $image['url'] . '">';
            echo '<img src="' . $image['url'] . '" alt="' . $image['alt'] . '">';
            echo '</a>';
        }
        echo '</div>';
    }
    ?>

    and here is the image of my settings:

    help?

    Plugin Author Archetyped

    (@archetyped)

    Thank you for the additional details.

    As your content is not part of standard post/page content, you can manually activate it for display in the lightbox using slb_activate() (documentation).

    Example:

    <?php
    $images = get_field('uk_clinic_images', 'option');
    // Start output buffering.
    ob_start().
    if ($images) {
        echo '<div class="luwi-gallery post-per-row-3">';
        foreach ($images as $image) {
            echo '<a href="' . $image['url'] . '">';
            echo '<img src="' . $image['url'] . '" alt="' . $image['alt'] . '">';
            echo '</a>';
        }
        echo '</div>';
    }
    // Save output to variable.
    $out = ob_get_clean();
    // Activate links in output.
    if ( function_exists('slb_activate') ) {
    	$out = slb_activate($out);
    }
    // Display output.
    echo $out;
    ?>
    Thread Starter stuartcr

    (@stuartcr)

    THANK YOU!!! for you fast response and help with fixing the issue!!

    I tried your code and at first it didnt work, But there was a easy fix

    ob_start().

    should be

    ob_start();

    so final WORKING code is:

    <?php
    $images = get_field('uk_clinic_images', 'option');
    // Start output buffering.
    ob_start(); // Removed the extra period here.
    if ($images) {
        echo '<div class="luwi-gallery post-per-row-3">';
        foreach ($images as $image) {
            echo '<a href="' . $image['url'] . '">';
            echo '<img src="' . $image['url'] . '" alt="' . $image['alt'] . '">';
            echo '</a>';
        }
        echo '</div>';
    }
    // Save output to variable.
    $out = ob_get_clean();
    // Activate links in output.
    if (function_exists('slb_activate')) {
        $out = slb_activate($out);
    }
    // Display output.
    echo $out;
    ?>
    

    thank you for your help again!!!

    Plugin Author Archetyped

    (@archetyped)

    Whoops! Glad you found the typo and got it working ????

    Thread Starter stuartcr

    (@stuartcr)

    Hey dude,

    I’m trying to implement the lightbox on this homepage image grid,

    https://newtopiadev.wpenginepowered.com/

    below is my Code, it appears to output correctly, when i inspect but doesnt seem to work.

    please can you help me?

    <?php
    $postGridArgs = array(
        'post_type'      => 'artwork',
        'posts_per_page' => 10,
        'post_status'    => 'publish',
    );
    
    $postGridItems = new WP_Query($postGridArgs);
    
    if ($postGridItems->have_posts()) :
    
    echo '<style>';
    
    echo '</style>'; ?>
    
    <script src="/wp-content/themes/flash-child/scripts/carousel-script.js"></script>
    
        <div class="outer-container">
            <div class="container">
                <div class="slider-wrapper">
                    <button id="prev-slide" class="slide-button material-symbols-rounded">
                        PREV
                    </button>
                    <ul class="image-list">
                        <?php
                        while ($postGridItems->have_posts()) : $postGridItems->the_post();
                            $image = get_field('artwork_image');
                            ob_start();
                            if (!empty($image)) :
                        
                        echo '<a href="' . $image['url'] . '">';
            echo '<img class="image-item" src="' . $image['url'] . '" alt="' . $image['alt'] . '">';
            echo '</a>';
                            endif;
                        $out = ob_get_clean();
    // Activate links in output.
    if ( function_exists('slb_activate') ) {
    	$out = slb_activate($out);
    }
                        // Display output.
    echo $out;
                        endwhile;
                        wp_reset_postdata();
                        // Save output to variable.
    
                        ?>
                    </ul>
                    <button id="next-slide" class="slide-button material-symbols-rounded">
                        NEXT
                    </button>
                </div>
                <div class="slider-scrollbar">
                    <div class="scrollbar-track">
                        <div class="scrollbar-thumb"></div>
                    </div>
                </div>
            </div>
        </div>
    
    <?php else :
        echo "<p>No posts found.</p>";
    endif;
    ?>
    Thread Starter stuartcr

    (@stuartcr)

    my settings

    Thread Starter stuartcr

    (@stuartcr)

    and i add the images heres using :

    [gallery]

    https://newtopiadev.wpenginepowered.com/homepage-test/

    again when i inspect i can see the “slb” code but it just not working, im not sure what i have done wrong?

    Help?

    Thread Starter stuartcr

    (@stuartcr)

    sooo i have tried everything. turned of all the plugins, swapped the theme. cannot get it working. so im aim for a fresh instal and start for stratch. so odd. i started an fresh WP install for testing and your plugin worked straight away!!!

    ill try again tomorrow

    Plugin Author Archetyped

    (@archetyped)

    SLB is most likely not working at the link provided due to HTTP Authentication being enforced sitewide.

    Per SLB’s Requirements, HTTP Authentication can block the loading of necessary files, preventing SLB from functioning properly.

    Disabling HTTP Authentication allows necessary files to be loaded for SLB to function normally.

    Thread Starter stuartcr

    (@stuartcr)

    thank you for getting back to me!!

    i just started again, strange as i have not done anything differently.

    BUT… i got it working!!

    here –> https://newtopia1.wpenginepowered.com/

    Plugin Author Archetyped

    (@archetyped)

    Glad to hear it’s working for you! As previously-noted, this is because HTTP authentication (requiring username/password to view the site) is not used on your new site, so all plugin files can be fully loaded.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘i cant seem to get it working’ is closed to new replies.