Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $bigimageUrl = wp_get_attachment_image_src($attachment_id,$size='full-size');
- $littleimageUrl = wp_get_attachment_image_src($attachment_id,$size='thumbnail');
- $title_raw = $attachment->post_title;
- $title = preg_replace("/[^a-zA-Z0-9s]/", " ", $title_raw);
- $alt_raw = get_post_meta($attachment_id, '_wp_attachment_image_alt', true);
- $alt = preg_replace("/[^a-zA-Z0-9s]/", " ", $alt_raw);
- echo '<img class="gallerytype" title="'; echo $title; echo '" alt="'; echo $alt; echo '" data-rsTmb="'; echo $littleimageUrl[0]; echo '" src="'; echo $bigimageUrl[0]; echo '"/> ';
- echo '<img class="gallerytype" title="';
- echo $title;
- echo '" alt="';
- echo $alt; echo '" data-rsTmb="';
- echo $littleimageUrl[0];
- echo '" src="';
- echo $bigimageUrl[0]; echo '"/> ';
- echo '<img class="gallerytype" title="', $title, '" alt="', ..., '"/> ';
- empty($alt) && $alt = $title;
- if (empty($alt)) $alt = $title;
Add Comment
Please, Sign In to add comment