WP custom field is not working..!
-
I am just started. I added a post type called videos and added a custom field named video_link. then I tried to add that custom field in my single-video.php with that
<?php echo get_post_meta($post->ID, ‘video_link’, true); ?>
but that is not showing the YT link.
https://i57.tinypic.com/wmnl7p.jpg
I even tried that in loop of recent post but not working:<div class="section group"> <?php //WordPress loop for custom post type $my_query = new WP_Query('post_type=videos&posts_per_page=9'); while ($my_query->have_posts()) : $my_query->the_post(); ?> <div class="col x4 vid_list"> <a href="<?php echo get_permalink(); ?>" title="<?php the_title(); ?> Video Download"><img src="<?php echo get_post_meta($post->ID, ‘video_link’, true); ?>" alt="<?php the_title(); ?>" /></a><br/> <a href="<?php echo get_permalink(); ?>" title="<?php the_title(); ?> Video Download"><?php the_title(); ?></a> </div> <?php endwhile; wp_reset_query(); ?> </div>
it output an empty value
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘WP custom field is not working..!’ is closed to new replies.