Disable Lightbox on a specific page

Support Area Forums Authentic Disable Lightbox on a specific page

Viewing 4 posts - 1 through 4 (of 4 total)
URL to the page in question:
  • Author
    Posts
  • #8801

    I recently started to use Authentic theme with great success. It’s a beautiful theme and quite easy to configure.

    However there is one issue I ran into that I haven’t been able to figure out.

    I am using the lightbox feature as I think it is a great feature. The curch wants to be able to uplad image galleries from certain events and for that I am using NextGen Gallery.

    The NextGen gallery is displayed on a single page. The NextGen gallery also has a built-in lightbox which has the advanted of scrolling through the whole gallery. Therefore I do need to disable Authentic Theme lightbox for this specific page.

    Is there a way for me to do this?

    #8809
    Bill Robbins
    Moderator

    Thank you for your business first of all and great question. It is possible to set the lightbox so it is not active on a particular page. What you’ll want to do is go to the Appearance section and select Edit. From the list of files on your right, choose ot-gallery.php and look for this spot:

    
    function organizedthemes_load_fancybox() {
    	if( !is_admin()){
    		   
    		wp_enqueue_script('fancybox');
    		wp_enqueue_script('fancy');
    	}
    }
    add_action('wp_enqueue_scripts', 'organizedthemes_load_fancybox');
    

    What you’ll want to do is change it to something like this:

    
    function organizedthemes_load_fancybox() {
    	if( !is_admin() || !is_page( 'Gallery' ) ){
    		   
    		wp_enqueue_script('fancybox');
    		wp_enqueue_script('fancy');
    	}
    }
    add_action('wp_enqueue_scripts', 'organizedthemes_load_fancybox');
    

    Which would disable the script on a page named Gallery. You’d need to replace Gallery above with the name of the page where you don’t want the script loaded.

    Once you save your changes that should take care of it for you.

    If you run into any questions or trouble, let me know.

    Thanks again,
    Bill

    #8812

    Thank you Bill

    At first this method did not work as I always got both lightboxes.

    But when I removed the is_admin() part is worked allright. The query is now:

    if(!is_page(1246) ){

    as the 1246 is the page number.

    #8819
    Bill Robbins
    Moderator

    That’s great. Enjoy your week.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Disable Lightbox on a specific page’ is closed to new replies.