Пример #1
0
function ac_render_slick_carousel_from_posts($posts, $args)
{
    // Do nothing if no posts
    if (empty($posts)) {
        return;
    }
    global $post;
    // Params to variables
    extract($args);
    // Classes
    $classes = '';
    if (isset($args['class'])) {
        $classes .= ' ' . $args['class'] . ' ';
    }
    ?>
	
  <div class="ac-slick-carousel clearfix <?php 
    echo $classes;
    ?>
">
		<?php 
    // Render each image
    foreach ($posts as $post) {
        setup_postdata($post);
        // Get the image ID.  Some are featured image, some are the actualy post
        $image_id = ac_get_post_thumbnail_id($post);
        $img = ac_resize_image_for_height(array('image_id' => $image_id, 'height' => 495, 'ratio' => AC_IMAGE_RATIO_PRESERVE));
        ?>
					
		  <div class="slick-slide">
		    <img class="slick-slide-img" src="<?php 
        echo $img['url'];
        ?>
" alt="<?php 
        esc_attr(the_title());
        ?>
" />
		  </div>
			
		<?php 
    }
    // image
    wp_reset_postdata();
    ?>
							
	</div>
			    
<?php 
}
Пример #2
0
<?php

/******************************/
/**** AC Showcase Template ****/
/******************************/
global $post;
// Template to style a single Showcase entry
// Get some values
$item_title = get_the_title($post->ID);
$thumb = ac_resize_image_for_columns(array('image_id' => ac_get_post_thumbnail_id($post->ID), 'columns' => $column_count));
$a_start = "<a href='" . get_permalink($post->ID) . "' >";
$a_end = "</a>";
// Hide read more link on some post types
$show_read_more = true;
if ($post_type == 'ac_gallery') {
    $show_read_more = false;
} elseif ($post_type == 'ac_person') {
    $show_read_more = false;
}
?>

<div class="ac-showcase-item" style="width:<?php 
echo $item_width;
?>
">
	<figure class='ac-hover-touch'>

		<?php 
// Thumbnail
?>
		<?php 
Пример #3
0
// 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;
        ?>
			</div>
		<?php 
    }
    ?>

		<?php 
    if ($show_title || $show_excerpt) {
        ?>
		<div class='text'>
			<?php 
        if ($show_title) {
Пример #4
0
/******************************/
global $post;
// Template to style a single Carousel entry
// Get some values
$item_title = get_the_title($post->ID);
// Get the thumbnail
$img_height = AC_IMAGE_RATIO_3BY2;
$img_crop = true;
$a_target_blank = false;
if (get_post_type($post) == 'ac_client') {
    // todo
    $img_height = AC_IMAGE_RATIO_SQUARE;
    $img_crop = false;
    $a_target_blank = true;
}
$args = array('image_id' => ac_get_post_thumbnail_id($post->ID), 'columns' => $column_count, 'ratio' => $img_height, 'crop' => $img_crop, 'use_placeholder' => true);
$thumb = ac_resize_image_for_columns($args);
// Build links
$a_start = '';
$a_end = '';
if (get_permalink($post->ID)) {
    $a_start = "<a href='" . get_permalink($post->ID) . "' ";
    // Check for extermal link
    if ($a_target_blank) {
        $a_start .= ' target="_blank" ';
    }
    $a_start .= " >";
    $a_end = "</a>";
}
$text_class = '';
// For attachment type (AC Gallery) use a lightbox
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 
}
Пример #6
0
                    $img_height_style = AC_IMAGE_RATIO_2BY1;
                    break;
            }
        }
    } else {
        if (get_post_type($post) == 'attachment') {
            // For image use lightbox
            $img = ac_resize_image_for_columns(array('image_id' => $post->ID, 'columns' => 12, 'ratio' => ac_get_height_style_for_post($post->ID)));
            // Don't include the pretty photo data in the text link
            $a_start = '<a class="prettyphoto" href="' . esc_url($img['url']) . '" rel="prettyPhoto[rel-' . ac_get_prettyphoto_rel() . ']">';
        }
    }
}
// Image
if (ac_has_post_thumbnail($post->ID)) {
    $img_args = array('image_id' => ac_get_post_thumbnail_id($post->ID), 'columns' => $img_cols, 'ratio' => $img_height_style, 'full_width' => $full_width);
    $image = ac_resize_image_for_grid($img_args);
}
// Excerpt
if ($show_excerpt) {
    // Sanitise some values
    $excerpt_length = false;
    $excerpt = ac_get_excerpt($post, $excerpt_length, false, true);
}
// Get terms slugs for Isotope filtering
$terms = ' all ';
$post_terms = get_the_terms($post->ID, $post_category);
if (!empty($post_terms)) {
    foreach ($post_terms as $post_term) {
        $terms .= ' ' . $post_term->slug . ' ';
    }