MOD for NextGen Gallery users
-
As a NextGen Gallery user, I encountered a problem showing my image URL for post where postthumbnail was not uploaded to the WP media gallery but picked from the NextGen Gallery. After a thorow research, I figured out how to get it work also in such cases by slightly modifying itempropwp.php.
if (function_exists('has_post_thumbnail')) { if ( has_post_thumbnail($post->ID)) { function get_image_path() { global $post; $id = get_post_thumbnail_id(); if(stripos($id,'ngg-') !== false && class_exists('nggdb')){ $nggImage = nggdb::find_image(str_replace('ngg-','',$id)); $thumbnail = array( $nggImage->imageURL, $nggImage->width, $nggImage->height ); } else { $thumbnail = wp_get_attachment_image_src($id,'full'); } $theimage = $thumbnail[0]; $theimage = str_replace('?uamfiletype=nggImage','',$theimage); return $theimage; } $ipwp_posth = get_image_path(); } }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘MOD for NextGen Gallery users’ is closed to new replies.