Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $testimonials = new WP_Query(array(
- 'post_type' => 'tesimonials',
- ));
- ?>
- <?php if ($testimonials->have_posts()) : ?> <?php while ($testimonials->have_posts()) : $testimonials->the_post(); ?>
- <?php
- $idd = get_the_ID();
- $tesimonial_img = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'tesimonila' );
- $clientname = get_post_meta($idd, 'client-name', true);
- $clientposition = get_post_meta($idd, 'client-position', true);
- $clientcompanyname = get_post_meta($idd, 'client-company-name', true);
- $clienttesidate = get_post_meta($idd, 'client-tesi-date', true);
- ?>
- <div class="single_testimonial_item floatleft">
- <div class="single_test_img floatleft">
- <?php if ($tesimonial_img) : ?>
- <a href="<?php the_permalink();?>"><img src="<?php echo $tesimonial_img[0];?>" alt="Tesimonial by <?php echo $clientname; ?> for Md Abul Bashar" /></a>
- <?php else : ?>
- <a href="<?php the_permalink();?>"><img src="<?php echo get_template_directory_uri();?>/img/default-img.jpg" alt="Tesimonial by <?php echo $clientname; ?> for Md Abul Bashar" /></a>
- <?php endif; ?>
- </div>
- <div class="clients_name">
- <?php if ($clientname) : ?>
- <h2><?php echo $clientname;?> <span><?php echo $clientposition; ?></span></h2>
- <?php else : ?>
- <h2><?php the_title();?> <span><?php echo $clientposition; ?></span></h2>
- <?php endif;?>
- </div>
- <div class="clients_say">
- <?php the_content();?>
- </div>
- <div class="testimonial_date_time">
- <p><?php if ($clienttesidate) : ?>Date: <?php echo $clienttesidate; ?> <?php endif;?> | <?php if ($clientcompanyname) : ?>Company Name: <?php echo $clientcompanyname; ?><?php endif; ?></p>
- </div>
- </div>
- <?php endwhile;?>
- <?php else : ?>
- <h2>Don't have Tesimonial</h2>
- <?php endif;?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement