WordPress.org

Ready to get started?Download WordPress

Forums

Dynamic Featured Image
[resolved] Featured image don't show in post (2 posts)

  1. vittorio.tanino
    Member
    Posted 8 months ago #

    Hello,
    I follow the steeps you described in Installation section. When I write a new post all works fine, I can select the featured image from my media gallery or from URL and I can show the thubnail in post edit form. I check "Featured Image 2" option at "screen options" but I can't see the feature image after saving post in my blog.
    I'm not sure if I have to follow steeps 4 and 5 in "description section" for correct use of plugin,if so, please, tell wich php files I need to edit.
    Thanks!

    http://wordpress.org/plugins/dynamic-featured-image/

  2. Ankit Pokhrel
    Member
    Plugin Author

    Posted 8 months ago #

    You need to fetch the featured image and display it in your bolg manually. The next version will have the feature to automatically display the data. For now you need to do it manually. To display the image in single blog post you can add following code in your single.php.

    if( function_exists('dfi_get_featured_images') ){
       $featuredImages = dfi_get_featured_images();
    
       //Loop through the image to display your image
    
       if( !is_null($featuredImages) ){
    
            $links = array();
    
            foreach($featuredImages as $images){
                $thumb = $images['thumb'];
                $fullImage = $images['full'];
    
                $links[] = "<a href='{$fullImage}' class='dfiImageLink'><img src='{$thumb}' alt='' height='{$height}' width='{$width}' /></a>";
            }
    
            echo "<div class='dfiImages'>";
            foreach($links as $link){
              echo $link;
            }
            echo "<div style='clear:both'></div>";
            echo "</div>";
         }
    
    }

    Thanks,
    Ankit

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.