WordPress.org

Ready to get started?Download WordPress

Forums

Custom fields IN widgets (2 posts)

  1. 2bak860
    Member
    Posted 5 years ago #

    Hello,

    I'm trying to get custom fields (specifically images) to show up in Widgets, but they're not having it. They'll show fine if I put them straight in the sidebar.php, but not when pasted into a Widget. Do Widgets strip custom fields that are images?

    Here's my code:

    <?php if (get_post_meta($post->ID, 'thumbnail', true)) { ?>
    
    <a href="<?php the_permalink(); ?>"><img class="alignnone size-thumbnail" title="<?php the_title(); ?>" alt="<?php the_title(); ?>" src="<?php echo get_post_meta($post->ID, 'thumbnail', true); ?>"/></a>
    
    <?php } else { ?><?php } ?>

    thanks in advance!

  2. 2bak860
    Member
    Posted 5 years ago #

    Anyone have any ideas?

Topic Closed

This topic has been closed to new replies.

About this Topic