小编Nes*_*med的帖子

是否可以在 $post->post_content 中获取帖子内容的 Elementor 样式?

我想得到什么? 我正在创建 Elementor 自定义小部件。这将输出特定帖子类型的帖子列表。到目前为止一切都很好。我得到了我需要的一切。但问题是,我必须使用 Elementor 自定义(使用 Elementor 创建)输出帖子内容。我使用过WP_Queryget_posts()。我得到的只是原始 HTML,没有任何 Elementor 自定义类。请检查图像 这就是问题所在

我做了什么?

public function wp_post_list($slug_name,$order='ASC',$orderby='date'){
        $args = [
                'post_type' => $slug_name,
                'posts_per_page' => -1,
                'orderby'          => $orderby,
                'order'            => $order,
            ];
            return $all_posts = new \WP_Query($args);
    }
public function post_list($slug_name,$order='ASC',$orderby='date'){
            $args = [
                    'post_type' => $slug_name,
                    'posts_per_page' => -1,
                    'orderby'          => $orderby,
                    'order'            => $order,
                ];
            $all_posts = get_posts($args);
            return $all_posts;
    }

public function skin_time_line($slug){

        $st = $this->get_settings_for_display();
        $order = $st['post_order'];
        $orderby = $st['post_orderby'];
        $posts = …
Run Code Online (Sandbox Code Playgroud)

php wordpress widget elementor

2
推荐指数
1
解决办法
1946
查看次数

标签 统计

elementor ×1

php ×1

widget ×1

wordpress ×1