WP отображает текст шорткода и HTML - PullRequest
0 голосов
/ 21 марта 2019

Внизу моей домашней страницы - прямо перед картой Google - я вставил портфолио-карусель с плагином Livemesh Addon.

http://justsen.dk.linux21.curanetserver.dk/

Как видите, он показывает как HTML-разметку, так и текст шорткода. Можно ли как-то скрыть текст шорткода?

Это то, что у меня есть (вставлено в мой файл function.php):

add_filter('lvca_posts_carousel_entry_excerpt', 'mytheme_modify_posts_carousel_entry_excerpt', 10, 3);

function mytheme_modify_posts_carousel_entry_excerpt($excerpt, $post_id, $settings) {

    $excerpt = '<div class="entry-summary">';

    $post = get_post( $post_id );

    $excerpt_count = 100;

    if (empty($post->post_excerpt))
        $excerpt .= $post->post_content;
    else
        $excerpt .= $post->post_excerpt;

    $excerpt .= do_shortcode(force_balance_tags(html_entity_decode(wp_trim_words(htmlentities($excerpt), $excerpt_count, '…'))));

    $excerpt .= '</div>';

    return $excerpt;

}
...