This topic has 2 replies, 2 voices, and was last updated 10 years by Abe.

  • Author
  • #8027
     krecikm
    Participant

    How I can use/edit shortcode ‘kleo_posts_carousel’ for display custom post type?

    #8064
     krecikm
    Participant

    I did it – works but it’s not be good idea?

    COPY CODE
    
    $args = array(
                'post_type' => 'dzieci',
                'taxonomy' => 'post_format',
                'field' => 'slug',
                'terms' => $terms_query
            );
            
            
            $latestPosts = new WP_Query(apply_filters('kleo_posts_carousel_args',$args));
            
            while ($latestPosts-> have_posts()) :$latestPosts-> the_post();
                
                switch (get_post_format()) {
                    
                    default:
                            $output .= '<li>';  
                            if (get_post_thumbnail_id())
                            {  
                                $output .= '<div class=""><a href="'.  get_permalink().'">';
                                $output .= '<span class="read"><i class="icon-'.apply_filters('kleo_img_rounded_icon','heart').'"></i></span>';
                                $output .= get_the_post_thumbnail(null,'blog_carousel');
                                $output .= '</a></div>';
                            }
                            $output .= '<h4>'.get_the_title().'</h4>';
                            $output .= '<p>'.  word_trim(get_the_excerpt(), 15, '...').'</p>';
                            $output .= '<p><a href="'.  get_permalink() .'"><i class="icon-angle-right"></i> '.__("ZOBACZ", 'kleo_framework').'</a></p>';
                            $output .= '</li>';
                        break;
                }
    
            endwhile;
          
            $output .= '</ul></div><!--end carousel-stories-->'.
    				'</div>';
    		
            return $output;
    
    #8103
     Abe
    Keymaster

    Hi, You don;t need to edit the shortcode code if you don’t want to extend its functionality.
    You just change the shortcode in your editor like:
    [kleo_posts_carousel post_types=dzieci]

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?