Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* Pretty Testimonial */
- function testimonial_shortcode($atts){
- global $pretty_testimonial_options; $pretty_testimonial_settings = get_option( 'pretty_testimonial_options', $pretty_testimonial_options );
- extract( shortcode_atts( array(
- 'posts_per_page' =>-1,
- 'id' =>'',
- 'category' =>'',
- 'bg_color' => $pretty_testimonial_settings['bg_color'],
- 'content_color' => $pretty_testimonial_settings['content_color'],
- 'client_title_color' => $pretty_testimonial_settings['client_title_color'],
- 'client_title_font_size' => $pretty_testimonial_settings['client_title_font_size'],
- 'name_of_post_color' => $pretty_testimonial_settings['name_of_post_color'],
- 'post_of_title' =>'',
- ), $atts, 'testimonials' ) );
- ob_start();
- $q = new WP_Query(
- array( 'posts_per_page' =>$posts_per_page, 'post_type' =>'testimonial-items', 'testimonial_cat' =>$category)
- );
- ?>
- <div style="background-color:'.$bg_color.'" id="testimonial" class="cd-testimonials-wrapper cd-container">
- <ul class="cd-testimonials">
- <?php
- while($q->have_posts()) : $q->the_post();
- $id = get_the_ID();
- $post_thumbnail = get_the_post_thumbnail ( get_the_ID(), 'post_thumbnail' );
- $post_of_title = get_post_meta ($id, 'post_of_title', true); ?>
- <li>
- <p style="color:<?php echo $content_color; ?>"><?php get_the_content(); ?></p>
- <div class="cd-author">
- <?php echo $post_thumbnail; ?>
- <ul class="cd-author-info">
- <li style="color:<?php echo $client_title_color; ?>;font-size:<?php echo $client_title_font_size; ?>px;"><?php get_the_title(); ?></li>
- <li style="color:<?php echo $name_of_post_color; ?>"><?php echo $post_of_title; ?></li>
- </ul>
- </div>
- </li>
- <?php
- endwhile; ?>
- </ul><a href="#0" class="cd-see-all">Show all</a></div>
- <?php
- while($q->have_posts()) : $q->the_post(); ?>
- <div class="cd-testimonials-all"> <div class="cd-testimonials-all-wrapper"> <ul>
- <?php
- endwhile;
- while($q->have_posts()) : $q->the_post();
- $idd = get_the_ID();
- $post_thumbnail = get_the_post_thumbnail ( get_the_ID(), 'post_thumbnail' ); ?>
- <li class="cd-testimonials-item">
- <p><?php get_the_content(); ?></p>
- <div class="cd-author">
- <?php echo $post_thumbnail; ?>
- <ul class="cd-author-info">
- <li><?php get_the_title(); ?></li>
- </ul>
- </div>
- </li>
- <?php
- endwhile; ?>
- </ul></div
- <?php
- while($q->have_posts()) : $q->the_post(); ?>
- <a href="#0" class="close-btn"></a></div>
- <?php
- endwhile;
- wp_reset_query(); ?>
- <script type="text/javascript">
- jQuery(document).ready(function($){
- jQuery("#testimonial").flexslider({
- selector: ".cd-testimonials > li",
- animation: "slide"
- });
- });
- </script>
- <?php
- return ob_get_clean();
- }
- add_shortcode('testimonial', 'testimonial_shortcode');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment