Elementor 显示相同的短代码两次。一个位于放置短代码的位置,另一个位于标题后面。该问题仅发生在编辑器中。页面上显示正常。请帮忙。我该如何修复它?
    function display_grid_func ( $atts ){
echo '<div class="post-grid">';
    $args = array(
        'post_type' => 'realizacje',
        'post_status' => 'publish',
        'posts_per_page' => 9,
        'cat' => 5
    );
    $loop = new WP_Query($args);
    while ($loop->have_posts()) : $loop->the_post(); ?>
        <div class="post-tile home">
            <a href="<?php the_permalink(); ?>">
                <img src="<?php the_post_thumbnail_url('tile-foto'); ?>" />
            </a>
                <a class="button-zobacz home" href="<?php the_permalink(); ?>">Zobacz →</a>
            
        </div>
    <?php endwhile;
    wp_reset_postdata();?><?php
    echo '</div>';
}
add_shortcode('post_grid', 'display_grid_func');
Run Code Online (Sandbox Code Playgroud)
到目前为止我尝试过的: -我更改了主题 -我关闭了所有插件 -我正在谷歌上查找