It seems to me the use of the “strip-shortcodes” function would solve a part of the problem (in your PHP code, file ig-posts-carousel-widget.php).
<?php
if ($show_excerpt) {
echo '<p class="excerpt">';
// if ( has_excerpt() ) { the_excerpt(); } else { echo wp_trim_words( get_the_content(), 20, '...' ); }
if ( has_excerpt() ) { the_excerpt(); } else { echo strip_shortcodes(wp_trim_words( get_the_content(), 20, '...' )); }
}
echo '</p>';
?>
-
This reply was modified 9 years, 2 months ago by
crouxel.
-
This reply was modified 9 years, 2 months ago by
crouxel.
The carousel shows the excerpt not the content
Your PHP code leads me think that you show an excerpt if it exists, otherwise you show content.
if ( has_excerpt() ) { the_excerpt(); } else { echo wp_trim_words( get_the_content(), 20, '...' ); }
I suggest the following change in order to show content without shortcode.
if ( has_excerpt() ) { the_excerpt(); } else { echo strip_shortcodes(wp_trim_words( get_the_content(), 20, '...' )); }
(in ig-posts-carousel-widget.php)
-
This reply was modified 9 years, 1 month ago by
crouxel.
-
This reply was modified 9 years, 1 month ago by
crouxel.