Title: data attributes dont work
Last modified: August 30, 2016

---

# data attributes dont work

 *  Resolved [Lazinbee](https://wordpress.org/support/users/lazinbee/)
 * (@lazinbee)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/data-attributes-dont-work/)
 * Hallo,
    the Plugin renders images with data attributes for responsive images (
   data-default, data-small, data-medium, …), but its always the same image. No 
   different sizes, always the full resolution. It is no problem of my installation,
   on your demo side, the plugin renders the images in the same way.
 * Beste regards
    Lazinbee
 * [https://wordpress.org/plugins/ultimate-responsive-image-slider/](https://wordpress.org/plugins/ultimate-responsive-image-slider/)

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

 *  [Weblizar – WordPress Themes & Plugin](https://wordpress.org/support/users/weblizar/)
 * (@weblizar)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/data-attributes-dont-work/#post-6803229)
 * Hi,
 * In slider plugin we have not provide any crop function.
 * There only default size are applicable.
 * Thanks
 *  Thread Starter [Lazinbee](https://wordpress.org/support/users/lazinbee/)
 * (@lazinbee)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/data-attributes-dont-work/#post-6803243)
 * 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
 *  [Weblizar – WordPress Themes & Plugin](https://wordpress.org/support/users/weblizar/)
 * (@weblizar)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/data-attributes-dont-work/#post-6803262)
 * 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](https://wordpress.org/support/users/lazinbee/)
 * (@lazinbee)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/data-attributes-dont-work/#post-6803297)
 * 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
 *  [Weblizar – WordPress Themes & Plugin](https://wordpress.org/support/users/weblizar/)
 * (@weblizar)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/data-attributes-dont-work/#post-6803307)
 * Thanks Lazinbee.

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

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

 * ![](https://ps.w.org/ultimate-responsive-image-slider/assets/icon-128x128.gif?
   rev=2305926)
 * [Ultimate Responsive Image Slider](https://wordpress.org/plugins/ultimate-responsive-image-slider/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-responsive-image-slider/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-responsive-image-slider/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-responsive-image-slider/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-responsive-image-slider/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-responsive-image-slider/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Weblizar – WordPress Themes & Plugin](https://wordpress.org/support/users/weblizar/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/data-attributes-dont-work/#post-6803307)
 * Status: resolved