Support » Plugin: Custom Post Carousels with Owl » Can I show the_content in exchange of the_excerpt?

  • Resolved lostchoi

    (@lostchoi)


    Hi and thanks for this excellent plugin.

    Is it possible to show the content, in my case I need to show some links related to the content, and the excerpt just takes off all links and tags.

    Thank you for your help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author thehowarde

    (@thehowarde)

    Hi @lostchoi

    Yes, you can use Filter Excerpt and use post content.

    I’m almost finished with a new version that has even more.

    Thread Starter lostchoi

    (@lostchoi)

    Thank you for your fast reply!
    Where do I need to add this filter? Functions maybe?

    Plugin Author thehowarde

    (@thehowarde)

    Hi @lostchoi

    Yes, put it in functions.php of your theme/child theme.

    add_filter('dd_carousel_filter_excerpt', 'filter_carousel_excerpt_callback', 10, 2);
    function filter_carousel_excerpt_callback($excerpt, $carousel_id){
        // Check your carousel ID is what you want replace integer_carousel_id with the carousel ID
         if ($carousel_id !== integer_carousel_id) return $excerpt;
        // Call the post in the carousel item with global post
        global $post;
    
        // Make your new $excerpt whatever you want.
        $new_excerpt = $post->post_excerpt;
    
        return $new_excerpt;
    
    }
    

    For example.

    Thread Starter lostchoi

    (@lostchoi)

    Thank you man!
    I’m going to try it.
    You’re awesome!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can I show the_content in exchange of the_excerpt?’ is closed to new replies.