Title: [Plugin: Lightbox 2] Prevent Plugin Loading
Last modified: August 19, 2016

---

# [Plugin: Lightbox 2] Prevent Plugin Loading

 *  Resolved [Indent](https://wordpress.org/support/users/indent/)
 * (@indent)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-lightbox-2-prevent-plugin-loading/)
 * Is there some way to prevent Lightbox 2 from loading on a frontpage?
    I have 
   jCarousel Lite working on the frontpage and Lightbox 2 kills all functionality
   in the slideshow. What I don’t have on the frontpage is images in need of Lightbox.
 * Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [Indent](https://wordpress.org/support/users/indent/)
 * (@indent)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-lightbox-2-prevent-plugin-loading/#post-1447099)
 * Anyone? I’m still looking for a solution.
 *  [mattapus](https://wordpress.org/support/users/mattapus/)
 * (@mattapus)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-lightbox-2-prevent-plugin-loading/#post-1447281)
 * Here is how I managed to solve this problem. Note that the example below only
   disables Lightbox on one post/page. To do so on multiple posts, you’ll have to
   mess around with the code a bit. Just replace “$pid = 240” with the post ID of
   your home page.
 * In functions.php in your active theme directory, add the following:
 *     ```
       // Remove lightbox action
       //wp_deregister_script('lightbox');
       function mytheme_remove_lightbox_js() {
         $pid = 240; // This is the post/page id you would like to disable lightbox on
         global $wp_query; // Call page query object
         if ($wp_query->post->ID == $pid) {
           // Remove lightbox scripts
           wp_deregister_script('lightbox');
           remove_action('wp_head', 'lightbox_styles');
         }
       }
       add_action( 'wp_print_scripts', 'mytheme_remove_lightbox_js', 100 );
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: Lightbox 2] Prevent Plugin Loading’ is closed to new replies.

## Tags

 * [frontpage](https://wordpress.org/support/topic-tag/frontpage/)
 * [lightbox2](https://wordpress.org/support/topic-tag/lightbox2/)
 * [loading](https://wordpress.org/support/topic-tag/loading/)

 * 2 replies
 * 2 participants
 * Last reply from: [mattapus](https://wordpress.org/support/users/mattapus/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-lightbox-2-prevent-plugin-loading/#post-1447281)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
