/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
theme_preprocess_node: /////////////////////// //Image caption text ////////////////////// $vars['content'] = _theme_altAsImageText($vars['content']); template.php: /** * Convert img tags alt text to caption text * * @param string $text The text with img tags in * * @return string The text with img tags and caption text from the alt field */ function _theme_altAsImageText($text) { foreach( $result[0] as $key => $img_tag) { } foreach( $result[0] as $key => $img_tag) { if($imgTextResult[$key]) { { $imgText = ' <div class="picture left"> <span></span>' . $img_tag . '<br /> ' . $imgTextResult[$key] . ' </div> '; } } } return $text; }
Comments
