/** * Function widget() contains data to show on frontend. * @param array $args of widget area. * @param array $instance current settings of widget. */ function widget($args, $instance) { global $post; global $wp_query; extract($args); $title = '<div class="title title-widget clearfix"><h2>' . __('Testimonials', 'wpsight') . '</h2></div>'; // $widget_title=apply_filters('widget_title', $title, $instance, $this->id_base); $per_page = $instance['post_no']; $order = $instance['post_sorting']; $effect = $instance['effect']; $time = $instance['time']; $testimonials = wp_testimonial_widget_query($order); if (!empty($testimonials)) { ?> <script type="text/javascript"> jQuery(document).ready(function() { var effect = '<?php echo $effect; ?> '; if(effect != 'none') { jQuery('.content_display').cycle({ fx: effect, timeout: '<?php echo $time; ?> ', fit: 1, next: '#testimonial-next', prev: '#testimonial-prev' }); jQuery("div.content_display").mouseover(function(){ jQuery(this).cycle('pause'); }).mouseout(function(){ jQuery(this).cycle('resume'); }); } }); </script> <?php echo $before_widget; echo $title; ?> <div class="control-buttons"> <div id="testimonial-prev" class="control-button prev">Previous</div> <div id="testimonial-next" class="control-button next">Next</div> </div> <div class='content_display'> <?php $output_data = wp_testimonial_widget_output($testimonials, $per_page); echo $output_data; ?> </div> <?php echo $after_widget; } }
* * @package Wpcasa * @subpackage Bayfront * @author anhbp */ ?> <div class="no-header-search"> <?php get_header(); ?> </div> <div id="container-wrap-main" class="testimonial-page"> <div id="main-wrap" class="wrap"> <div class="container"> <?php $testimonials = wp_testimonial_widget_query('asc'); ?> <?php if (!empty($testimonials)) { ?> <?php foreach ($testimonials as $i => $testi) { ?> <div class="testimonial_wrap clear"> <!--span class="testimonial_avatar"></span--> <?php if (!empty($testi->description)) { ?> <p class="testimonial_content testimonial_content_body"><?php _e(stripslashes($testi->description)); ?>