'Testimonials', 'singular_name' => 'Testimonials', 'menu_name' => 'Testimonials', 'parent_item_colon' => 'Parent Testimonial:', 'all_items' => 'All Testimonials', 'view_item' => 'View Testimonial', 'add_new_item' => 'Add New Testimonial', 'add_new' => 'New Testimonial', 'edit_item' => 'Edit Testimonial', 'update_item' => 'Update Testimonial', 'search_items' => 'Search Testimonials', 'not_found' => 'No Testimonials found', 'not_found_in_trash' => 'No Testimonials found in Trash', ); $args = array( 'label' => 'Testimonials', 'description' => 'Testimonials post type', 'labels' => $labels, 'supports' => array( 'title', 'excerpt', 'thumbnail', 'revisions', 'page-attributes', 'editor'), 'hierarchical' => true, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 5, 'can_export' => true, 'has_archive' => false, 'exclude_from_search' => false, 'capability_type' => 'page', 'menu_icon' => plugins_url( 'gm_icon_bw.png', __FILE__ ), ); register_post_type( 'testimonials', $args ); } // Hook into the 'init' action add_action( 'init', 'create_testimonials', 0 ); ?> 'DSC', 'orderby' => 'date', // allow client to sort 'posts_per_page' => '-1', // number of testimonials per page 'meta_key' => '', 'classes' => '', 'testimonial_id' => '', 'display' => 'content', ), $atts ) ); $paged = ( get_query_var( 'paged' ) ) ? absint( get_query_var( 'paged' ) ) : 1; $db_args = array( 'post_type' => 'testimonials', 'order' => $order, 'orderby' => $orderby, 'meta_key' => $meta_key, 'posts_per_page' => $posts_per_page, 'classes' => $classes, 'p' => $testimonial_id, 'paged' => $paged, ); $content = ''; $testimonials_loop = new WP_Query( $db_args ); if($testimonials_loop->have_posts()) { switch($display) { case "content": $content .= '
'; while( $testimonials_loop->have_posts() ) : $testimonials_loop->the_post(); $fields = get_fields(); $experience = get_field('overall_collegewear_experience'); // echo '
';
// 					var_dump($experience);
// 					echo '
'; $content_filtered = get_the_content(); $content_filtered = apply_filters('the_content', $content_filtered); $content_filtered = str_replace(']]>', ']]>', $content_filtered); $content .= '
'; $content .= '

' .get_the_date(). '

'; $content .= '
'; $content .= '
'; $content .= '
'; $content .= '

'.$content_filtered.'

'; $content .= '
'; // end testimonial-info $content .= '
'; $content .= '

'.get_the_title().'

'; if ($fields['city']) { $content .= '

'.$fields['city']. ', '.$fields['state'].'

'; } $content .= '
'; // end testimonial-name $content .= '
'; // end col-sm-8 $content .= '
'; $content .= '
'; $content .= '
'; $content .= '

CollegeWear Experience

'; if( $experience == 'AMAZING!' ) { $content .= ''; } elseif($experience == 'Fantastic') { $content .= ''; } elseif($experience == 'Good') { $content .= '

Good!

'; } elseif($experience == 'Okay') { $content .= '

Okay!

'; } else { $content .= '

Bad!

'; } $content .= '

Order Again?

'; $content .= ''; $content .= '
'; $content .= '
'; // end testimonial-pic $content .= '
'; // end col-sm-4 $content .= '
'; // end row $content .= '
'; // testimonial-single" endwhile; $content .= '
'; // end wrapper break; case "excerpt": $content .= '
'; while( $testimonials_loop->have_posts() ) : $testimonials_loop->the_post(); $content .= '
'; $content .= ''; $content .= '
'.get_the_excerpt().'
'; $content .= '
'; endwhile; $content .= '
'; break; case "well": $content .= '
'; $content .= '
'; while( $testimonials_loop->have_posts() ) : $testimonials_loop->the_post(); $content .= '
'; $content .= '
'; $content .= '
'; $content .= get_the_post_thumbnail($post->ID, 'thumbnail', array('class' => "img-responsive")); $content .= '
'; $content .= '

'.get_the_excerpt().'

'; $content .= '
'; $content .= '

'.get_the_title().'

'; $content .= '
'; $content .= '
'; $content .= '
'; $content .= '
'; endwhile; $content .= '
'; $content .= '
'; break; case "list": $content .= ''; break; case "random": $content .= '
'; while( $testimonials_loop->have_posts() ) : $testimonials_loop->the_post(); $content_filtered = get_the_content(); $content_filtered = apply_filters('the_content', $content_filtered); $content_filtered = str_replace(']]>', ']]>', $content_filtered); $content .= '
'; $content .= '
'; $content .= '
'.$content_filtered.'
'; $content .= '
'; $content .= '

'.get_the_title().'

'; $content .= '
'; // end .testimonial-name $content .= '
'; // end .testimonial-content $content .= '
'; // end .testimonial-single endwhile; $content .= '
'; // end .row break; } } wp_reset_postdata(); return $content; } add_shortcode( 'gm_testimonials', 'gm_testimonials_shortcode' ); /* Testimonial Carousel */ function gm_carousel_shortcode( $atts ){ extract( shortcode_atts( array( 'order' => 'ASC', 'orderby' => 'rand', // choose random entries 'meta_key' => '', // meta_key 'posts_per_page' => '6', // number of testimonials you need 'classes' => 'col-sm-6', 'per_slide' => '2', // number of testimonials per slide 'max_items' => '12', // max testimonials 'interval' => '5000', 'display' => 'content', ), $atts ) ); $db_args = array( 'post_type' => 'testimonials', 'order' => $order, 'orderby' => $orderby, 'meta_key' => $meta_key, 'posts_per_page' => $posts_per_page, 'classes' => $classes, 'per_slide' => $per_slide, 'max_items' => $max_items, 'interval' => $interval, ); $carousel_loop = new WP_Query( $db_args ); $testimonial_count = 1; $content = ''; if($carousel_loop->have_posts()) { switch($display) { case "content": $content .= ''; // end .carousel-wrapper break; case "excerpt": $content .= ''; // end .carousel-wrapper break; } } wp_reset_postdata(); return $content; } add_shortcode( 'gm_carousel_testimonials', 'gm_carousel_shortcode' ); 'Timeline', 'singular_name' => 'Timeline', 'menu_name' => 'Timeline', 'parent_item_colon' => 'Parent Timeline:', 'all_items' => 'All Events', 'view_item' => 'View Timeline', 'add_new_item' => 'Add New Event', 'add_new' => 'New Event', 'edit_item' => 'Edit Event', 'update_item' => 'Update Event', 'search_items' => 'Search Event', 'not_found' => 'No Events found', 'not_found_in_trash' => 'No Events found in Trash', ); $args = array( 'label' => 'Timeline', 'description' => 'Timeline post type', 'labels' => $labels, 'supports' => array( 'title', 'excerpt', 'thumbnail', 'revisions', 'page-attributes', 'editor'), 'hierarchical' => true, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 5, 'can_export' => true, 'has_archive' => false, 'exclude_from_search' => false, 'capability_type' => 'page', 'menu_icon' => plugins_url( 'gm_icon_bw.png', __FILE__ ), ); register_post_type( 'timeline', $args ); } add_action( 'init', 'gm_timeline', 0 ); ?> 'ASC', 'orderby' => 'menu_order', // allow client to sort ), $atts ) ); $db_args = array( 'post_type' => 'timeline', 'order' => $order, 'orderby' => $orderby, 'posts_per_page' => -1, ); $timeline_loop = new WP_Query( $db_args ); $content = ''; $i=0; if($timeline_loop->have_posts()) { $content .= '
'; $content .= '

Start

'; $content .= '
'; while( $timeline_loop->have_posts() ) : $timeline_loop->the_post(); $content_filtered = get_the_content(); $content_filtered = apply_filters('the_content', $content_filtered); $content_filtered = str_replace(']]>', ']]>', $content_filtered); $content .= '
'; $class = ''; if($i > 0) { $class = 'is-hidden'; }else { $class = ''; } $content .= '
'; $content .= '
'; $content .= '

'.get_the_title().'

'; $content .= '

'.$content_filtered.'

'; $content .= '
'.get_the_post_thumbnail().'
'; $content .= '
'; $content .= '
'; $i++; endwhile; $content .= '
'; // end #gm-timeline $content .= '

Today

'; $content .= '
'; // end .timeline-wrap } wp_reset_postdata(); return $content; } add_shortcode( 'gm_timeline', 'gm_timeline_shortcode' ); CollegeWear, Inc.
Quality Custom T-Shirts, Standard Free Shipping, and All-Inclusive Pricing