Plugin Not Working On MultiNews Theme
-
The MultiNews theme show only local featured image and not external featured image made by your plugin.
The images which are uploaded locally are visible, others are not visible.
There’s a file in framework folder named “function.php” there’s a code which I think needs to be edited. I have tried everything, but couldn’t make it work.
function mom_post_image($size = 'thumbnail', $id='', $pid = '', $di = false){ global $post; $image = ''; //get the post thumbnail if ($pid == '') { $pid = $post->ID; } if ($id != '') { $image_id = $id; } else { $image_id = get_post_thumbnail_id($pid); } $image = wp_get_attachment_image_src($image_id, $size); $image = $image[0]; if ($image) return $image; //if the post is video post and haven't a feutre image global $posts_st; $extra = get_post_meta($pid, $posts_st->get_the_id(), TRUE); $format = get_post_format($pid); if (isset($extra['video_type'])) { $vtype = $extra['video_type']; } if (isset($extra['video_id'])) { $vId = $extra['video_id']; } if (isset($extra['html5_poster_img'])) { $html5_poster = $extra['html5_poster_img']; } else { $html5_poster = ''; } if($format == 'video') { if($vtype == 'youtube') { $image = 'http://img.youtube.com/vi/'.$vId.'/0.jpg'; } elseif ($vtype == 'vimeo') { $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/$vId.php")); $image = $hash[0]['thumbnail_large']; } elseif ($vtype == 'html5') { $image = $html5_poster; } elseif ($vtype == 'daily') { $image = 'http://www.dailymotion.com/thumbnail/video/'.$vId; } elseif ($vtype == 'facebook') { $image = 'https://graph.facebook.com/'.$vId.'/picture'; } } if($format == 'gallery') { global $posts_st; $extra = get_post_meta($id , $posts_st->get_the_id(), TRUE); $slides = isset($extra['slides']) ? $extra['slides'] : ''; $image_id = isset($slides[0]['imgid']) ? $slides[0]['imgid'] : ''; $image = wp_get_attachment_image_src($image_id, $size); $image = $image[0]; } if ($image) return $image; //If there is still no image, get the first image from the post if (mom_option('post_first_image') == 1) { if (mom_get_first_image($pid) !== '') { return mom_get_first_image($pid,$size); } } $default_image = get_template_directory_uri().'/images/no-image.jpg'; if (mom_option('post_default_img') == 1) { if (mom_option('custom_default_img', 'url') != '') { return mom_option('custom_default_img', 'url'); } else { return $default_image; } } else { if ($di == true) { return $default_image; } else { return ; } } } function mom_get_first_image($id, $size = 'thumbnail') { $post_id = $id; $queried_post = get_post($post_id); $first_img = ''; ob_start(); ob_end_clean(); $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $queried_post->post_content, $matches); $first_img = ''; if (isset($matches[1][0])) {$first_img = $matches[1][0];} global $mom_thumbs_sizes; $w = isset($mom_thumbs_sizes[$size][0]) ? $mom_thumbs_sizes[$size][0] : ''; $h = isset($mom_thumbs_sizes[$size][1]) ? $mom_thumbs_sizes[$size][1] : ''; $first_img = vt_resize( '', $first_img, $w, $h, true ); if (isset($first_img['url'])) { return $first_img['url']; } else { return ''; } } function mom_post_image_full($size = 'thumbnail', $hd = '', $alt = '', $id = ''){ if (mom_post_image($size, $id) != '') { if ($hd == '') { $hd = $size; } if ($alt == '') { $alt = esc_attr(get_the_title()); } global $mom_thumbs_sizes; $w = isset($mom_thumbs_sizes[$size][0]) ? $mom_thumbs_sizes[$size][0] : ''; $h = isset($mom_thumbs_sizes[$size][1]) ? $mom_thumbs_sizes[$size][1] : ''; //$w = ''; $h = ''; if( has_post_thumbnail() || mom_option('theme_thumb') != 1) { $thumb = get_post_thumbnail_id(); $image = vt_resize( $thumb, mom_post_image($size, $id), $w, $h, true ); if($image['url'] != ''){ $output = '<img src="'.$image['url'].'" data-hidpi="'.mom_post_image($hd, $id).'" alt="'.$alt.'" width="'.$image['width'].'" height="'.$image['height'].'">'; } else { $output = '<img src="'.mom_post_image($size, $id).'" data-hidpi="'.mom_post_image($hd, $id).'" alt="'.$alt.'" width="'.$image['width'].'" height="'.$image['height'].'" style="max-height:'.$h.'px;">'; } } else { $output = '<img src="'.mom_post_image($size, $id).'" data-hidpi="'.mom_post_image($hd, $id).'" alt="'.$alt.'" width="'.$w.'" height="'.$h.'">'; } //$output .= 'SHARE_FROM_IMAGES'; echo $output; } else { return false; } } /* ---------------------------------------------------------------------------- */Any help would be highly appreciated.
Thanks in advance.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Plugin Not Working On MultiNews Theme’ is closed to new replies.