WordPress.org

Ready to get started?Download WordPress

Forums

Carousel Horizontal Posts Content Slider
[resolved] The plugin breaks my page (4 posts)

  1. pacosrfs
    Member
    Posted 7 months ago #

    Hi, i've put your plugin in my page under a slide and all the content below appears in the wrong place and some carousels with flexslider don´t work.

    I use <?php echo TCHPCSCarousel(); ?> to put it in the page.
    I´ve edited some thing i didn´t want, like the read more button. Also, i played with the css but that´s not the problem.
    This is the code as it is now:

    [ Moderator note: please wrap code in backticks or use the code button. Do not use blockquote. ]

    function Carousel_shortcode()
    {
    	global $wpdb;
    	$displayimage = get_option('tchpcs_displayimage');
    	$word_imit = get_option('tchpcs_word_limit');
    	$qp_showposts = get_option('tchpcs_query_posts_showposts');
    	$qp_orderby= get_option('tchpcs_query_posts_orderby');
    	$qp_order= get_option('tchpcs_query_posts_order');
    	$qp_category= get_option('tchpcs_query_posts_category');
    
    	//Image slider
    	global $post;
    
    	$slider_gallery.= '<div class="image_carousel">';
    	$slider_gallery.='<div id="foo1">';
    
    	$args = array( 'numberposts' => $qp_showposts,  'category' => $qp_category, 'order'=> $qp_order, 'orderby' => $qp_orderby, 'post_type' => 'any'  );
    	$myposts = get_posts( $args );
    	foreach( $myposts as $post ){
    
    		$post_title = $post->post_title;
    		$post_link =  get_permalink($post->ID);
    		$post_content = $post->post_content;
    		$displaydesc= $word_imit;
    
    		$slider_gallery.= '<div id="foo_content">';
    
    		if($displayimage=="YES"){
    
    			 if (has_post_thumbnail( $post->ID ) ):
    			$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
    			endif; 
    
    			$featured_img = "<img width='180' height='142' src='". $image[0] . "' " . $attributes . " />";
    
    			$slider_gallery.= '<a href="'.$post_link.'">'.$featured_img.'</a>';
    		}
    
    		//Post title, Post Description, Post read more
    		$slider_gallery.= '<h6><a href="'.$post_link.'">'.$post_title.'</a></h6>';
    
    		$slider_gallery.= '</div>';
    
    	}
    
    	$slider_gallery.='</div>';
    	$slider_gallery.='</div>';
    
    	return $slider_gallery;
    
    }

    http://wordpress.org/plugins/carousel-horizontal-posts-content-slider/

  2. subhansanjaya
    Member
    Plugin Author

    Posted 7 months ago #

    Please, check the premium version of this plugin which has many new features, bugs fixed and enabled to work with other sliders.

  3. pacosrfs
    Member
    Posted 7 months ago #

    Sorry, forgot to post it. I fixed it with <?php wp_reset_query(); ?> at the end of the widget.

  4. subhansanjaya
    Member
    Plugin Author

    Posted 7 months ago #

    Thanks for letting me know.

Reply

You must log in to post.

About this Plugin

About this Topic