Tag Info

Hot answers tagged


Assuming we are viewing some king of single - post, page, custom post type etc. <?php $imgs_meta = get_post_meta( get_the_ID(), 'AP_post_image', true ); if ( '' != $imgs_meta ) { $imgs = explode( ',', $imgs_meta ); foreach ( $imgs as $src ) printf( '<img src="%s" />', esc_url( $src ) ); }


I believe the primary problem in your code is the $custom_values is set after you try to use it (and you need to use the same variable name). Otherwise, it doesn't have a value when it's in post_class(). In fact, I'm surprised you're not getting an error. That variable needs to get the value before the call to post_class. <?php $custom_values = ...

Only top voted, non community-wiki answers of a minimum length are eligible