Echo custom field value

Repost for any future googlers from @StenW ‘s wordpress plugin support thread:

Github user @atnon made a very similar modification to the code 10 days ago, also using custom-fields (though giving the image a link rather than putting a link in the caption). You can see this code in his pull request.

I re-wrote his code and released an update to the plugin last night, so if you’re happy with just the image having a link you should be able to do that with the update.

If I were you, I’d update the plugin to incorporate my new code and then make a small edit just to change where the link is being printed in the output. That way you get a cleaner meta-box instead of relying on custom fields and it should work without much debugging.

Example modification (untested):

<div class="item <?php echo $key == 0 ? 'active' : ''; ?>">
    <?php echo $image['image'];
    if($atts['showcaption'] === 'true') { ?>
        <div class="carousel-caption">
            <h4><?php echo $image['title']; ?></h4>
            <p><?php echo $image['content']; ?></p>
            <?php if($image['url']) {
                echo '<a href="'.$image['url'].'"';
                if($image['url_openblank']) {
                    echo ' target="_blank"';
                }
                echo '>Läs mer</a>';
            } ?>
        </div>
    <?php } ?>
</div>