Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #182918

    Hi,

    Im migrating a rather big blog (~800 Posts) to Enfold. So far I’m making good progress, but now I’m stuck at some point:
    The old blog did not use featured images but rather had a custom field with the url of the image (don’t ask why).

    So what I’m trying to do is to change loop-index.php in a way that it checks for this custom field and uses the image found there, or if it’s empty use a featured image.

    Any hints on how to accomplish this?

    Thank you,

    #183203

    Hi kaMai!

    You replace these lines with the get_post_meta for custom fields:

    //on single page replace the link with a fullscreen image
            if(is_singular())
            {
                $link = avia_image_by_id(get_post_thumbnail_id(), 'large', 'url');
            }
    
            //echo preview image
            if(strpos($blog_style, 'big') !== false)
            {
                if($slider) $slider = '<a href="'.$link.'">'.$slider.'</a>';
                if($slider) echo '<div class="big-preview '.$blog_style.'">'.$slider.'</div>';
            }

    Cheers!
    Ismael

    #183350

    Alrighty, thanks Ismael!

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘How to use featured images from a custom field’ is closed to new replies.