• Resolved shaunbowen

    (@shaunbowen)


    Hi there, is there an option to process shortcodes in the excerpts used in the Posts Grid widget? They currently just resolve to a blank space.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author livemesh

    (@livemesh)

    Can you try adding this to your theme functions.php and see if that works for you –


    add_filter('the_excerpt', 'do_shortcode');

    Thread Starter shaunbowen

    (@shaunbowen)

    Hi there, sorry for the delay.

    I tried adding that to my theme’s functions.php file, but unfortunately it didn’t work.

    I have successfully changed the excerpt length and ‘read more’ text with these codes further up in my functions.php file:

      // Add Read More to Excerpts
    function new_excerpt_more( $more ) {
        return ' <a class="read-more" href="'. get_permalink( get_the_ID() ) . '">' . __('Read More...', 'your-text-domain') . '</a>';
    }
    add_filter( 'excerpt_more', 'new_excerpt_more' );
    
    //Filter the except length to 80 characters.
    function mytheme_custom_excerpt_length( $length ) {
        return 15;
    }
    add_filter( 'excerpt_length', 'mytheme_custom_excerpt_length', 999 );
    Plugin Author livemesh

    (@livemesh)

    The following code works for me with the free version of the plugin.

    add_filter( 'get_the_excerpt', 'do_shortcode');

    The premium version of posts grid has a setting which helps process shortcodes and preserve formatting.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Shortcodes in Excerpts – Posts Grid’ is closed to new replies.