コード例 #1
0
<?php

/******************************************/
/**** AC Carousel Testimonial Template ****/
/******************************************/
global $post;
// Template to style a single Carousel Testimonial entry
?>
<div class="ac-carousel-content">
<?php 
// Simply render a testimonial
echo ac_testimonial_render($post->ID);
?>
</div>
コード例 #2
0
function ac_render_royalslider_from_posts($posts, $args)
{
    // RoyalSlider expects content in the RS HTML Structure, so do nothing if no posts
    if (empty($posts)) {
        return;
    }
    global $post;
    // Defaults
    $auto_height = false;
    // Params to variables
    extract($args);
    // $post_parent is the gallery id
    // hide_titles is a gallery setting
    $hide_titles = false;
    // Default to true for Easy Slider, general use
    if (isset($post_parent)) {
        $hide_titles = get_post_meta($post_parent, 'hide-titles', true);
    }
    // Ensure proper boolean
    $hide_titles = filter_var($hide_titles, FILTER_VALIDATE_BOOLEAN);
    // Get the slideshow settings from the Options
    $autoplay = ac_bool_to_string(shoestrap_getVariable('aeis_autoplay'));
    $transition = shoestrap_getVariable('aeis_transition');
    $delay = shoestrap_getVariable('aeis_slideshow_delay');
    if ($delay) {
        $delay = $delay * 1000;
        // miliseconds
    } else {
        $delay = 5000;
    }
    $rs_split_nav = false;
    // Check if no click by nav defined
    if (defined('AC_RS_SPLIT_NAV')) {
        $rs_split_nav = true;
    }
    // Classes
    $classes = '';
    if ($slider_size == 'letterbox') {
        $classes = 'ac-full-width-row';
    }
    if (isset($args['class'])) {
        $classes .= ' ' . $args['class'] . ' ';
    }
    ?>
	
  <div class="ac-royalSlider sliderContainer fullWidth clearfix <?php 
    echo $classes;
    ?>
 <?php 
    echo $slider_style;
    ?>
 <?php 
    echo $slider_size;
    ?>
" data-show-title="<?php 
    echo $show_title;
    ?>
" data-show-excerpt="<?php 
    echo $show_excerpt;
    ?>
" data-slider-size="<?php 
    echo $slider_size;
    ?>
" data-delay="<?php 
    echo $delay;
    ?>
" data-autoplay="<?php 
    echo $autoplay;
    ?>
" data-transition="<?php 
    echo $transition;
    ?>
" data-split-nav="<?php 
    echo $rs_split_nav;
    ?>
" data-auto-height="<?php 
    echo json_encode($auto_height);
    ?>
">
	  <div class="royalSlider heroSlider rsMinW full-width-slider">
		<?php 
    // Render each image
    if ($posts) {
        foreach ($posts as $post) {
            setup_postdata($post);
            // Links
            $a_start = '';
            $a_end = '';
            // Only add links for the slider-posts.  Gallery shouldn't click through
            if ($slider_style == 'slider-post') {
                $a_start = "<a href='" . get_permalink($post->ID) . "'>";
                $a_end = "</a>";
            }
            // Get the post type
            $post_type = get_post_type($post);
            // For testimonials write out the HTML
            if ($post_type == 'ac_testimonial') {
                ?>
				  <div class="rsContent">
						<?php 
                echo ac_testimonial_render($post->ID);
                ?>
					</div>
				<?php 
            } else {
                // Other post types
                // Get the image ID.  Some are featured image, some are the actualy post
                $image_id = ac_get_post_thumbnail_id($post);
                // Resize differently for different scenarios
                if ($slider_size == 'nearby') {
                    $img = ac_resize_image_for_height(array('height' => 495, 'ratio' => AC_IMAGE_RATIO_PRESERVE));
                    $img_args = array('image_id' => $image_id, 'columns' => 1, 'ratio' => AC_IMAGE_RATIO_PRESERVE, 'ensure_min_width' => false);
                } else {
                    $img_args = array('image_id' => $image_id, 'columns' => 12, 'ratio' => AC_IMAGE_RATIO_PRESERVE, 'full_width' => $full_width);
                    $img = ac_resize_image_for_columns($img_args);
                }
                // For nearby images we set the data width and height
                $rsw = '';
                $rsh = '';
                if ($slider_size == 'nearby') {
                    $rsw = ' data-rsw="' . $img['width'] . '" ';
                    $rsh = ' data-rsh="495" ';
                }
                // Check if the titles are required
                $title = '';
                $content = '';
                if ($hide_titles !== true) {
                    // Get the title
                    $title = $a_start . get_the_title() . $a_end;
                    // Get the content
                    $content = $post->post_content;
                    $content = apply_filters('the_excerpt', $content);
                    // Use the_excerpt as the_content returns the actual image in the content
                    $content = str_replace('//]]>', ']]&gt;', $content);
                    $content = "<div class='excerpt'>" . $content . "</div>";
                    $content = $a_start . ac_person_get_position() . $content . $a_end;
                }
                ?>
					
				  <div class="rsContent">
				    <img class="rsImg" <?php 
                echo $rsw;
                ?>
 <?php 
                echo $rsh;
                ?>
 src="<?php 
                echo $img['url'];
                ?>
" alt="<?php 
                esc_attr(the_title());
                ?>
" />
				    <div class="infoBlock infoBlockLeftBlack rsABlock" data-fade-effect="" data-move-offset="10" data-move-effect="bottom" data-speed="200">
				      <div class="caption"><?php 
                echo $title;
                ?>
</div>
				      <div class="description"><?php 
                echo $content;
                ?>
</div>
				    </div>
				  </div>			  
				
				<?php 
            }
            ?>
				
			<?php 
        }
        // image
        wp_reset_postdata();
    }
    ?>
		</div>
							
		<!--Control Bar-->
		<div class='ac-rs-overlay'></div>		
		<div class="ac-rs-controls-wrapper load-item">
				
			<!-- Caption -->
			<div class="slidecaption"></div>
			
			<!-- Description -->
			<div class="slidedescription"></div>				

		</div>
	</div>
		    
<?php 
}
コード例 #3
0
<div class='ac-grid-col <?php 
echo esc_attr($classes);
?>
 <?php 
echo $cols_class . esc_attr($terms) . esc_attr(ac_get_hide_until_fade_class());
?>
'>	
	<div class='ac-grid-post'>
	
	<?php 
// Write out the post
// Check for content overrides
// Testimonials and Post-Quotes use testimonial format
if (get_post_type() == 'ac_testimonial' || get_post_type() == 'post' && get_post_format() == 'quote') {
    echo ac_testimonial_render($post->ID, true, $excerpt_length);
} else {
    ?>

		<?php 
    if (ac_has_post_thumbnail($post->ID)) {
        ?>
			<div class='image'>				
				<?php 
        echo $a_start;
        ?>
				<?php 
        echo ac_resize_image_for_grid(array('image_id' => ac_get_post_thumbnail_id($post->ID), 'columns' => $cols, 'ratio' => $image_aspect_ratio));
        ?>
				<?php 
        echo $a_end;
コード例 #4
0
echo ac_person_get_position();
?>
			
					 
				<?php 
if ($show_excerpt) {
    echo $excerpt;
}
?>
		 
				
				<?php 
if (get_post_type($post) == 'ac_testimonial') {
    ?>
					<?php 
    echo ac_testimonial_render($post->ID, false, 250);
    ?>
				<?php 
}
?>
			
				
				<?php 
// Footer: Terms or Social
?>
		
				<?php 
if (get_post_type($post) == 'ac_person') {
    ?>
					<div class='ac-tile-footer'>
						<?php