pusatdata

WP Plugin: Solved Featured Image From URL not show image

Jan 22nd, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. This step by step:
  2.  
  3. 1. Create file thumbnail.html in .../wp-content/plugins/featured-image-from-url/includes/html/, and PUT THIS CODE:
  4. <a href="http://adf.ly/665625/<?php echo $url; ?>" target="_blank">
  5. <img
  6. src="<?php echo $url; ?>" onError="this.src='/nocover.jpg';"
  7. alt="<?php echo $alt; ?>" >
  8. </img></a>
  9.  
  10. 2. Open file thumbnail.php in ..../wp-content/plugins/featured-image-from-url/includes/, and FIND THIS CODE:
  11.  
  12.  
  13. line 46::
  14.  
  15. function fifu_get_html($url, $alt) {
  16. return sprintf('<!-- Featured Image From URL plugin --> <img src="%s" alt="%s"></img>', $url, $alt);
  17. }
  18.  
  19. add_filter('the_content', 'fifu_add_to_content');
  20.  
  21. function fifu_add_to_content($content) {
  22. if (is_singular() && has_post_thumbnail() && get_option('fifu_content') == 'toggleon')
  23. return get_the_post_thumbnail() . $content;
  24. else
  25. return $content;
  26. }
  27.  
  28. add_filter('wp_get_attachment_url', 'fifu_replace_attachment_url', 10, 2);
  29.  
  30. function fifu_replace_attachment_url($att_url, $att_id) {
  31. if (get_option('fifu_attachment_id') == $att_id) {
  32. if (is_admin())
  33. $att_url = '/wp-content/plugins/featured-image-from-url/admin/images/fifu-text.jpg';
  34. else {
  35. $url = get_post_meta(get_the_ID(), 'fifu_image_url', true);
  36. if ($url)
  37. $att_url = $url;
  38. }
  39. }
  40. return $att_url;
  41. }
  42.  
  43. REPLACE WITH THIS CODE:
  44.  
  45. function fifu_get_html($url, $alt) {
  46. include 'html/thumbnail.html';
  47. return sprintf('<!-- Featured Image From URL plugin --> <img src="%s" alt="%s"></img>', $url, $alt);
  48.  
  49. }
Add Comment
Please, Sign In to add comment