• Resolved Chris

    (@comradeseidl)


    Hi,

    I love your theme, and I’m very happy using it.

    However, I noticed that when using shortcodes in a video post–and even after disabling the plugin that uses said shortcodes–that the layout breaks. I have implemented a fix.

    I posted this in the theme’s functions.php file (knowing that I’ll have to do it again after updating):

    function remove_shortcode_from_index( $content ) {
      if ( is_home() || is_archive() ) {
        $content = preg_replace('/\[.*\]/', '', $content);
      }
      return $content;
    }
    add_filter( 'the_excerpt', 'remove_shortcode_from_index' );

    In content-link.php, content-quote.php, and content-video.php, I altered lines 46, 46, and 52 respectively to apply the “the_excerpt” filter as follows:

    echo  '<p class="post-excerpt">' . mb_strimwidth( apply_filters( 'the_excerpt', $content_parts['extended'] ), 0, 200, '...') . '</p>';
  • The topic ‘Shortcodes break layout, fix implemented’ is closed to new replies.