コード例 #1
0
}
// Exit if accessed directly
yit_enqueue_script('yit-testimonial', YIT_Testimonial()->plugin_assets_url . '/js/yit-testimonial-frontend.min.js', array('jquery'), null, true);
yit_enqueue_script('owl-carousel', YIT_Testimonial()->plugin_assets_url . '/js/owl.carousel.min.js', array('jquery'));
wp_reset_query();
$args = array('post_type' => 'testimonial');
$args['posts_per_page'] = isset($items) && $items != '' ? $items : -1;
if (isset($cat) && !empty($cat)) {
    $cat = array_map('trim', explode(',', $cat));
    $args['tax_query'] = array(array('taxonomy' => 'category-testimonial', 'field' => 'id', 'terms' => $cat));
}
$options = get_option('yit_testimonial_options');
$text_type = YIT_Testimonial()->get_option('text-type-testimonials');
$limit_words = YIT_Testimonial()->get_option('limit-words-testimonials');
$limit = $limit_words != '' ? $limit_words : 50;
$thumbnail = YIT_Testimonial()->get_option('thumbnail-testimonials') == '' ? 'yes' : YIT_Testimonial()->get_option('thumbnail-testimonials');
$tests = new WP_Query($args);
if (!$tests->have_posts()) {
    return false;
}
$i = 0;
$row = 2;
while ($tests->have_posts()) {
    $tests->the_post();
    if ($i == 0 || $i % $row == 0) {
        echo '<div class="row-fluid">';
    }
    if ($text_type == 'excerpt') {
        $length = create_function('', "return {$limit};");
        add_filter('excerpt_length', $length);
        $text = get_the_excerpt();
コード例 #2
0
 /**
  * Get the list of testimonials
  *
  * Retrieve an array of testimonials, if the plugin is active
  *
  * @param array
  * @since  2.0.0
  * @param array $default_value | an array with the default value
  * @return Array
  * @author Andrea Grillo <*****@*****.**>
  */
 function yit_get_testimonial_list_array($default_value = array())
 {
     $testimonials_list = array();
     if (function_exists('YIT_Testimonial')) {
         $testimonials = new WP_Query(array('post_type' => YIT_Testimonial()->testimonial_post_type, 'posts_per_page' => -1));
         if (!empty($testimonials)) {
             if (!empty($default_value)) {
                 $testimonials_list = $default_value;
             }
             foreach ($testimonials->posts as $testimonial) {
                 $testimonials_list[$testimonial->ID] = $testimonial->post_title;
             }
         } else {
             $testimonials_list = false;
         }
     } else {
         $testimonials_list = false;
     }
     return $testimonials_list;
 }
コード例 #3
0
ファイル: markup.php プロジェクト: jabue/wordpress
$show_share         = ! empty( $socials ) ? true : false ;
$share_title        = $portfolio->get( 'share_title' );
$share_socials      = $portfolio->get( 'share_socials' );
$path               = $this->locate_file( 'single', $layout );
$taxonomy           = $portfolio->config->taxonomy;
$is_lookbook        = 'yes' == $portfolio->get( 'config-enable_lookbook' ) ? true : false;
$gallery            = $portfolio->get('gallery');

if( ! function_exists( 'YIT_Testimonial' ) || $testimonial_id == -1 || empty( $testimonial_id ) ){
    $show_testimonial = false;
}else{
    $show_testimonial = true;
    $testimonial_query = new WP_Query(
        array(
            'p'              => $testimonial_id,
            'post_type'      => YIT_Testimonial()->testimonial_post_type,
            'posts_per_page' => 1
        )
    );

    $testimonial = $testimonial_query->posts[0];
}

$attachments_args = array(
    'post_type'      => 'attachment',
    'numberposts'    => -1,
    'post_status'    => 'any',
    'post_mime_type' => 'image',
    'orderby'        => 'menu_order',
    'order'          => 'ASC',
    'post__not_in'   => array( get_post_thumbnail_id() )
コード例 #4
0
     * add a slider testimonial widget
     *
     * @return void
     * @since  1.0
     * @author Emanuela Castorina <*****@*****.**>
     */
    public function register_widget()
    {
        include $this->plugin_path . '/yit-testimonials.widget.php';
        register_widget('YIT_Testimonials_Widget');
    }
}
/**
 * Main instance of plugin
 *
 * @return object
 * @since  1.0
 * @author Emanuela Castorina <*****@*****.**>
 */
function YIT_Testimonial()
{
    return YIT_Testimonial::instance();
}
/**
 * Instantiate Testimonial class
 *
 * @since  1.0
 * @author Emanuela Castorina <*****@*****.**>
 */
YIT_Testimonial();