Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Dumitru Brinzan

    (@ilovewpcom)

    Hi,

    The instructions in that post say the following:
    “Simply include the player’s embed code”.

    What you are doing is adding a shortcode into the excerpt, not an embed code. Shortcodes are not parsed in excerpts (default WordPress behavior).

    Best regards,
    Dumitru

    Thread Starter stevesanda

    (@stevesanda)

    So, it looks like the plugin I’d like to use in my excerpt only provides a shortcode. I’m curious what the embed code for the default player is, as I’m stumbling to find this as well.

    I’ve also found some documentation to enable shortcodes in the excerpt by adding a line to the functions.php file to the current theme (see here: https://envato.com/blog/wordpress-excerpts/). I’ve done this to my installation of the podcast theme, but the shortcodes are not parsed:

    /var/html/wordpress/wp-content/themes/podcast/functions.php

    /* Custom Excerpt Length
    ==================================== */
    
    function new_excerpt_length($length) {
            return 45;
    }
    add_filter('excerpt_length', 'new_excerpt_length');
    add_filter('the_excerpt', 'do_shortcode');
    add_filter('the_excerpt', 'shortcode_unautop');
    • This reply was modified 4 years, 7 months ago by stevesanda.
    Thread Starter stevesanda

    (@stevesanda)

    Ok, I found an example of the embed code for audio that works for the excerpt: https://www.w3schools.com/tags/tag_audio.asp

    However, I’m still hopeful that there’s a workaround for shortcodes in the excerpt.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Shortcode in site excerpt showing string, not plugin’ is closed to new replies.