Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    In slider plugin we have not provide any crop function.

    There only default size are applicable.

    Thanks

    Thread Starter Lazinbee

    (@lazinbee)

    Okay, maybe I’ll find a solution. I’m not very confirm to wordpress so I find no way to get the original ID of the images insertet to a slider In the file uris-layout.php on line 113 the image output takes place.

    I think I can modify the URLs with this
    $medium_image_url = wp_get_attachment_image_src( Original-ID-of-the-Image, ‘medium’);
    $URLmedium = parse_url($medium_image_url[0], PHP_URL_PATH);

    and then
    data-medium=”<?php echo $Urlmedium; ?>”

    But I don’t find any way to get the Original-ID-of-the-Image? Do you have any idea how I can get this ID?

    Best Regards
    Lazinbee

    HI,

    Open plugin folder and the open this file ultimate-responsive-image-slider.php on any editor.

    Go to near line 395 , there you will get this function wp_get_attachment_image_src and image id.

    Thanks

    Thread Starter Lazinbee

    (@lazinbee)

    Now I find a solution wich works for me. Its a little bit custom. I defined some custom image sizes in my child theme.

    This is the modyfied code in uris-layout.php

    foreach($RPGP_AllPhotosDetails as $RPGP_SinglePhotoDetails) {
    	$Title = $RPGP_SinglePhotoDetails['rpgp_image_label'];
    	$Desc = $RPGP_SinglePhotoDetails['rpgp_image_desc'];
    	$Url = $RPGP_SinglePhotoDetails['rpgp_image_url'];
    
    	// Get the Original ID of images
    	$imageID  = attachment_url_to_postid( $Url );
    
    	$UrlData = get_intermediate_image_sizes();
    
    	// Default Image
    	$DataImages_data_src = wp_get_attachment_image_src( $imageID, $UrlData[7]);
    
    	// Small Image
    	$DataImages_data_small = wp_get_attachment_image_src( $imageID, $UrlData[11]);
    
    	// Medium Image
    	$DataImages_data_medium = wp_get_attachment_image_src( $imageID, $UrlData[12]);
    
    	// Large Image
    	$DataImages_data_large = wp_get_attachment_image_src( $imageID, $UrlData[2]);
    
    	// Retina Image
    	$DataImages_data_retina = wp_get_attachment_image_src( $imageID, $UrlData[13]);	
    
    	$i++;
    	?>
    	<div class="sp-slide">
    		<img class="sp-image" alt="<?php echo $Title; ?>" src=""
    			data-src="<?php echo $DataImages_data_src[0]; ?>"
    			data-small="<?php echo $DataImages_data_small[0]; ?>"
    			data-medium="<?php echo $DataImages_data_medium[0]; ?>"
    			data-large="<?php echo $DataImages_data_large[0]; ?>"
    			data-retina="<?php echo $DataImages_data_retina[0]; ?>"/>

    If you like you can use it for the plugin.

    Best regards
    Lazinbee

    Thanks Lazinbee.

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

The topic ‘data attributes dont work’ is closed to new replies.