Title: [Plugin: Lightbox 2] limit plugin to only single post??
Last modified: August 20, 2016

---

# [Plugin: Lightbox 2] limit plugin to only single post??

 *  [azn137](https://wordpress.org/support/users/azn137/)
 * (@azn137)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-lightbox-2-limit-plugin-to-only-single-post/)
 * How do you limit the plugin to being loaded ONLY on single posts and pages? I’ve
   tried to modified the code, but it seems to not do anything at all.
 *     ```
       global $post;
       if (!is_single($post) && !is_admin()) { // if we are *not* viewing an admin page, like writing a post or making a page:
       	wp_enqueue_script('lightbox', ($stimuli_lightbox_plugin_prefix.$stimuli_lightbox_js), array('scriptaculous-effects'), '1.8');
       }
       ```
   
 * Please help…
 * [http://wordpress.org/extend/plugins/lightbox-2/](http://wordpress.org/extend/plugins/lightbox-2/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [azn137](https://wordpress.org/support/users/azn137/)
 * (@azn137)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-lightbox-2-limit-plugin-to-only-single-post/#post-2545154)
 * I meant
    `(is_single($post)` and not `(!is_single($post)` Anyone?

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Lightbox 2] limit plugin to only single post??’ is closed to
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/lightbox-2.svg)
 * [Lightbox 2](https://wordpress.org/plugins/lightbox-2/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/lightbox-2/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/lightbox-2/)
 * [Active Topics](https://wordpress.org/support/plugin/lightbox-2/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/lightbox-2/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/lightbox-2/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [azn137](https://wordpress.org/support/users/azn137/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-lightbox-2-limit-plugin-to-only-single-post/#post-2545154)
 * Status: not resolved