Support » Plugin: Carousel Horizontal Posts Content Slider » give category to the function

  • Hi to all, if you want to decide which category do you want to display in your category-{slug}.php , so you can have your template category file with your slider you can modified such a few line of code. i know that i don’t have to modified core file , but this change it’ll insert in new release.
    in your plugin folder open the file: carousel-horizontal-posts-content-slider.php, i add the parameter ($num) to the first two function like this at lines 18-20-22-30->

    //page function
    function TCHPCSCarousel($num)
    	echo Carousel_shortcode($num);
    function Carousel_shortcode($num)
    	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= $num;

    so in your template category file you can write the category ID to the shortcode, so it will be:
    <?php echo TCHPCSCarousel(241); ?>
    where 241 is the category ID i want to show.
    In the admin area you have to leave blank the input text for:
    Display post Categories
    i don’t know how to modified the Short code for posts:- [carousel-horizontal-posts-content-slider]

    Maybe can be useful to someone.

  • The topic ‘give category to the function’ is closed to new replies.