Flex Slider not adding Alt text
-
Hey all, I have purchased a theme which has flex-slider integrated. The issue is that I cannot choose the alt text.
I am posting two sets of code, the first is the postbox which lets me add new slides and the second is the function which displays the slider. I have found that I am looking for the $title variable, but it seems not to be populating when it’s displayed.
Any ideas would be amazing!
Postbox HMTL
‘<li id=”slide-1″ class=”postbox”>
<div class=”handlediv” title=”Click to toggle”>?</div>
<h3 class=”hndle”><span>Slide ‘.$meta_key.'</span></h3>
<div class=”inside”>
<table class=”form-table cmb_metabox”>
<tr>
<th style=”width:18%”><label>Background URL</label></th>
<td>
<input class=”cmb_upload_file” type=”text” size=”45″ id=”‘. $field[‘id’] .’_bg_’.$meta_key.'” name=”‘. $field[‘id’] .'[‘.$meta_key.’][bg]” value=”” />
<input class=”cmb_upload_slider button” type=”button” value=”Upload Image” />
</td>
</tr><tr>
<th style=”width:18%”><label>Image URL</label></th> <td> <input class=”cmb_upload_file” type=”text” size=”45″ id=”‘. $field[‘id’] .’_image_’.$meta_key.'” name=”‘. $field[‘id’] .'[‘.$meta_key.’][image]” value=”” /> <input class=”cmb_upload_slider button” type=”button” value=”Upload Image” /> </td> </tr> <tr> <th style=”width:18%”><label>Caption</label></th> <td> <textarea name=”‘. $field[‘id’] .'[‘.$meta_key.’][caption]” cols=”60″ rows=”8″></textarea> </td> </tr> </table> <button class=”button-secondary slide_delete_button”>Remove Slide</button> </div>’Below is the function
‘function azure_resizer($url = ”, $width = 150, $height = 150, $cropping = true, $title = ”)
{
if ( empty($url) ) return;if ( strstr( $url, site_url() ) ) {
$image_url = aq_resize( $url, $width, $height, $cropping );
} else {
$path = pathinfo($url);
$new_url = ‘-‘.$width.’x’.$height.’.’.$path[‘extension’];
$image_url = str_replace(‘.’.$path[‘extension’], $new_url, $url);if ( !getimagesize($image_url) ) $image_url = $url;
}$out = ‘<img src=”‘. $image_url .'” alt=”‘. $title .'” />’;
echo $out;
}’
- The topic ‘Flex Slider not adding Alt text’ is closed to new replies.