Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter melichades

    (@melichades)

    solved partially:

    created an second page, containing a list of full-width, one-column “thumbnails”, cropped to the full width of the page e.g. 1024px:
    crop: width: 1024px height: 0

    altered the quality-field in includes/global/common.php / this is a real crude solution 🙁
    if ($retina) $quality=15; else $quality=30;
    (how could i do this in my own functions.php?)

    inserted a function in my functions.php that changes all links to the permalink of the details-page:

    add_filter( 'envira_gallery_pre_data', 'tgm_envira_disable_lightbox', 10, 2 );
    function tgm_envira_disable_lightbox( $data, $gallery_id ) {
    	// You can target this by specific ID if you want. If you want this for all galleries, just remove this line. Change 324 to your gallery ID.
    	// if ( 324 !== $gallery_id ) {	return $data; }
    
    	// Change the link field for each image.
    	foreach ( (array) $data['gallery'] as $id => $item ) {
    		if ( ! empty( $data['gallery'][$id]['link'] ) ) {
    			// only, if no page is targeted:
                            if (substr(strtolower($data['gallery'][$id]['link']),-4,4)=='.jpg') {
    				$data['gallery'][$id]['link']=get_page_link();
    				$data['gallery'][$id]['link']=preg_replace('/\/$/', '_detail/', $data['gallery'][$id]['link'] );
    				// link back to preview-page
                                    $data['gallery'][$id]['link']=preg_replace('/_detail_detail\/$/', '/', $data['gallery'][$id]['link'] );
    			}
    		}
    		// fill the alt-tag
                    $data['gallery'][$id]['alt']=$data['gallery'][$id]['caption'];
    		// fill title tag
                    $data['gallery'][$id]['title']=$data['gallery'][$id]['caption'];
    	}
    	return $data;
    }
Viewing 1 replies (of 1 total)