Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This step by step:
- 1. Create file thumbnail.html in .../wp-content/plugins/featured-image-from-url/includes/html/, and PUT THIS CODE:
- <a href="http://adf.ly/665625/<?php echo $url; ?>" target="_blank">
- <img
- src="<?php echo $url; ?>" onError="this.src='/nocover.jpg';"
- alt="<?php echo $alt; ?>" >
- </img></a>
- 2. Open file thumbnail.php in ..../wp-content/plugins/featured-image-from-url/includes/, and FIND THIS CODE:
- line 46::
- function fifu_get_html($url, $alt) {
- return sprintf('<!-- Featured Image From URL plugin --> <img src="%s" alt="%s"></img>', $url, $alt);
- }
- add_filter('the_content', 'fifu_add_to_content');
- function fifu_add_to_content($content) {
- if (is_singular() && has_post_thumbnail() && get_option('fifu_content') == 'toggleon')
- return get_the_post_thumbnail() . $content;
- else
- return $content;
- }
- add_filter('wp_get_attachment_url', 'fifu_replace_attachment_url', 10, 2);
- function fifu_replace_attachment_url($att_url, $att_id) {
- if (get_option('fifu_attachment_id') == $att_id) {
- if (is_admin())
- $att_url = '/wp-content/plugins/featured-image-from-url/admin/images/fifu-text.jpg';
- else {
- $url = get_post_meta(get_the_ID(), 'fifu_image_url', true);
- if ($url)
- $att_url = $url;
- }
- }
- return $att_url;
- }
- REPLACE WITH THIS CODE:
- function fifu_get_html($url, $alt) {
- include 'html/thumbnail.html';
- return sprintf('<!-- Featured Image From URL plugin --> <img src="%s" alt="%s"></img>', $url, $alt);
- }
Add Comment
Please, Sign In to add comment