Title: excluding single pages
Last modified: August 22, 2016

---

# excluding single pages

 *  Resolved [kengw002](https://wordpress.org/support/users/kengw002/)
 * (@kengw002)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/excluding-single-pages/)
 * Hi there
 * Love your plugin. thanks for creating it.
 * I’m no coder that’s for sure but I do know how to put your code into the functions.
   php (in my child theme) but thats all I know how to do.
 * Without an explanation I dont know where amongst that code I need to add the 
   page address for the one I want to avoid your plugin working on.
 * Can you please provide me with an example of your code with a dummy page address
   so I can replace that with my own?
 * that way I can easily see the spot I need to put the web address.
 * thanks in advance
 * Grant
 * [https://wordpress.org/plugins/rocket-lazy-load/](https://wordpress.org/plugins/rocket-lazy-load/)

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

 *  Thread Starter [kengw002](https://wordpress.org/support/users/kengw002/)
 * (@kengw002)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/excluding-single-pages/#post-5461769)
 * hey mate, could you also provide a second example to follow to exclude multiple
   pages too
 * that would be very helpful too
 * cheers Grant
 *  [Julio Potier](https://wordpress.org/support/users/juliobox/)
 * (@juliobox)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/excluding-single-pages/#post-5461921)
 * Hello
 * We have a filter named “do_rocket_lazyload”, it returns a boolean value.
 * So you can do this :
 *     ```
       add_action( 'template_include', 'wprocket_no_lazy_load' );
       function wprocket_no_lazy_load() {
         if ( in_array( get_queried_object_id(), array( 1, 2, 3 ) ) {
           add_filter( 'do_rocket_lazyload', '__return_false' );
         }
       }
       ```
   
 * You can change/add/delete values from the array with 1,2,3 🙂
 * See you!
 *  Thread Starter [kengw002](https://wordpress.org/support/users/kengw002/)
 * (@kengw002)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/excluding-single-pages/#post-5461929)
 * ok but how does it know which “single page” that I want to exclude?
 * I don’t quite understand, can someone from your company do this for me, i’m happy
   to pay what is required.
 * cheers Grant
 *  [Julio Potier](https://wordpress.org/support/users/juliobox/)
 * (@juliobox)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/excluding-single-pages/#post-5461933)
 * The 1, 2, 3 are the ids, if you want to do this for 1 page, just use 1 id.
    If
   you want to do this for all single pages (like posts, or pages) do this :
 *     ```
       add_action( 'template_include', 'wprocket_no_lazy_load' );
       function wprocket_no_lazy_load() {
         if ( is_singular() ) {
           add_filter( 'do_rocket_lazyload', '__return_false' );
         }
       }
       ```
   
 * but it quite useless to use the plugin now.
 * Try to explain more your needs, what is a “single page” if it’s not an ID?
 *  [michaelwmahoney](https://wordpress.org/support/users/michaelwmahoney/)
 * (@michaelwmahoney)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/excluding-single-pages/#post-5462059)
 * I’m thinking I can create a template for a particular type of page, for example
   a gallery page, and add to the template something like:
 * function wprocket_no_lazy_load() {
    add_filter( ‘do_rocket_lazyload’, ‘__return_false’);}
 * Then choose the created template whenever I want a page that doesn’t lazyload.
 *  [michaelwmahoney](https://wordpress.org/support/users/michaelwmahoney/)
 * (@michaelwmahoney)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/excluding-single-pages/#post-5462060)
 * I created another page template by copying and renaming page.php in my theme 
   directory. I retitled it:
 *     ```
       /*
       Template Name: Gallery Page
       */
       ```
   
 * …and added the filter from a support post on Rocket Lazy Loader:
 *     ```
       <?php
       /*---Don't Lazy Load---*/
       add_filter( 'do_rocket_lazyload', '__return_false' );
       ?>
       ```
   
 * …then saved and uploaded the new template to my theme directory. WP will pick
   up the new template, simply choose it from the available templates in the list
   on the page edit screen.
 *  [Julio Potier](https://wordpress.org/support/users/juliobox/)
 * (@juliobox)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/excluding-single-pages/#post-5462061)
 * Yes, this is a great solution too.
    Thanks!

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

The topic ‘excluding single pages’ is closed to new replies.

 * ![](https://ps.w.org/rocket-lazy-load/assets/icon-256x256.png?rev=2715509)
 * [LazyLoad Plugin – Lazy Load Images, Videos, and Iframes](https://wordpress.org/plugins/rocket-lazy-load/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/rocket-lazy-load/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/rocket-lazy-load/)
 * [Active Topics](https://wordpress.org/support/plugin/rocket-lazy-load/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/rocket-lazy-load/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/rocket-lazy-load/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [Julio Potier](https://wordpress.org/support/users/juliobox/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/excluding-single-pages/#post-5462061)
 * Status: resolved