• Resolved steevithak

    (@steevithak)


    Here’s a sample of the code I’m using to display the images attached to a page:

    $attachments = get_posts($args);
    if($attachments) {
      foreach($attachments as $attachment) {
        $content = '<a href="' . guid . '">';
        $content .= wp_get_attachment_image($attachment->ID, array(160,160));
        $content .= '</a>';
        $content = slb_activate($content);
        echo $content;
      }
    }

    The rendered page shows all the 160×160 thumbs as expected but when I click one of them it just takes me to the full size image as if lightbox weren’t loaded. Here’s an excerpt of the rendered HTML for one image (I’ve removed the actual domain name for security reasons):

    <a href="http://www.x.com/dev/wp-content/uploads/gallery-101.jpg"><img width="160" height="160" src="http://www.x.com/dev/wp-content/uploads/gallery-101-160x160.jpg" class="attachment-160x160" alt="gallery-10" /></a>

    The jQuery version being used is v1.11.2. Simple Lightbox plugin is activated and, on the settings page, is enabled and the enabled for posts and pages checkboxes are checked. No javascript errors show on the console.

    The PODS plugin is also installed on this wordpress.

    Any suggestions on what else I should do to debug?

    https://wordpress.org/plugins/simple-lightbox/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter steevithak

    (@steevithak)

    FWIW, I’ve verified wp_head() and wp_footer() are present and I can see that the lightbox code is being inserted into the page when I do a view source in the browser. I’ve tried rendering the page with the_content() as well as the_excerpt() but neither helps. Can’t provide a directly link because the site is on an internal server. Any suggestions on how to further debug appreciated. (also any suggestions on alternate plugins that provide similar functionality would we welcome).

    Plugin Author Archetyped

    (@archetyped)

    Hi, judging from the link’s output, it looks like the links are not being activated by SLB. The code to build the links that you posted should work, but without a link there is unfortunately not much I can do to further narrow down the issue.

    If you can post a link to a test server, I would be glad to take a closer look. You can also check to see if there are any plugins causing conflicts with SLB.

    Thread Starter steevithak

    (@steevithak)

    Unfortunately, it’s not possible to provide an external link to the dev site. What I can do, is load up a fresh wordpress install on a public server and try to duplicate the problem there. If I can do that, I’ll share the link here. (and if it doesn’t exhibit the same problem, that may provide the answer I’m looking for anyway).

    Thread Starter steevithak

    (@steevithak)

    So I duplicated the full wordpress install on a public server and lightbox worked perfectly. After pulling my hair out trying find any difference between the working and non-working wordpress sites, I finally realized there was none. Every file and database table is identical. But I found the problem. Simple Lightbox fails if the website is protected by an htaccess login. Apache is configured to protect all our dev sites that way. Once I realized that, I was able to reproduce the problem at will on the public test site by adding or removing basic authentication via an .htaccess file. Any idea if there’s a way to make Lightbox play nice with htaccess authentication? Maybe a specially configured rule or something?

    Thread Starter steevithak

    (@steevithak)

    Ok, more information on this. The offending request is not being generated from javascript within the web browser but by some part of lightbox on the server, which seems really weird. Each time lightbox is loaded, a single http request originates from an agent “WordPress/4.2.2” at our web server’s IP address and hits:

    /wp-content/plugins/simple-lightbox/themes/baseline/layout.html

    All other requests related to lightbox originate from the client web browser either directly or through ajax/jquery. Any idea what that one request is and why the server is requesting something from itself?

    Plugin Author Archetyped

    (@archetyped)

    Hi, glad to hear you were able to track down your issue! SLB uses WordPress’ built-in functionality that may be blocked by HTTP authentication when making local requests.

    See here for more information on SLB’s requirements.

    Thread Starter steevithak

    (@steevithak)

    Right, not debating the requirements, I’m asking if you know why the odd HTTP self-request is being made. It seems like it would be more efficient (and safer) to simply load the file locally. Can you point me to the actual code (or at least the PHP file) where this request is generated within the simple lightbox plugin?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘not working with 2013 theme’ is closed to new replies.