stuart-d
12/10/2013 - 6:12 PM

Make WooSlider plugin show full HTML content instead of excerpts in slide layout. Place this code in your WordPress theme functions.php fil

Make WooSlider plugin show full HTML content instead of excerpts in slide layout. Place this code in your WordPress theme functions.php file.

<?php
add_filter( 'wooslider_slides_layout_html', 'wooslider_custom_content', 10, 3);
 
function wooslider_custom_content ( $content, $args, $post ) {
	global $post;
 
	$image = get_the_post_thumbnail( get_the_ID() );
	
	if ( 'true' == $args['link_slide'] || 1 == $args['link_slide'] ) {
		$wooslider_url = get_post_meta( get_the_ID(), '_wooslider_url', true );
		$image = '<a href="' . esc_url( $wooslider_url ) . '">' . $image . '</a>';
	}
	if ( ( 'true' == $args['display_content'] || 1 == $args['display_content'] ) || ( 'true' == $args['display_title'] || 1 == $args['display_title'] ) ) {
		$title = get_the_title();
		$content = get_the_content();
		$content = apply_filters('the_content', $content);
		$content = str_replace(']]>', ']]&gt;', $content);
		$content = '<div class="slide-excerpt"><h2 class="slide-title">' . $title . '</h2>' . $content . '</div>';
		if ( $args['layout'] == 'text-top' ) {
			$content = $content . $image;
		} else {
			$content = $image . $content;
		}
	} else {
		$content = $image;
	}
 
	return $content;
}
?>