/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $custom_post = new WP_Query(); $custom_post->query('post_type=testimonial&showposts=1&orderby=rand'); ?> <?php while ($custom_post -> have_posts()) : $custom_post -> the_post(); ?> <div class="post_type"> <?php the_content();?> <span class="name right clear"> <?php echo get_post_meta($post->ID, 'custom_post_type_name', $single = true); ?> <?php echo get_post_meta($post->ID, 'custom_post_type_title', $single = true); ?> </span> </div> <?php endwhile; ?>