Home Forums Themes Support How to render Footer Posttype when use Elementor

Tagged: ,

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #8174

    Hi all customer,

    In our theme now use WPBakery Page Builder and they are not compatible with Elementor.

    You can try to make it work with Elementor by go to: wp-content/themes/xxx/templates/footer then open file footer.php and replace old code by this code:

    $footer_id = get_post_meta( get_the_ID(), 'haru_'.'footer', true );
    if ( $footer_id == '' ) {
    $footer_id = haru_get_option('haru_footer');
    }
    
    $args = array(
    'orderby' => 'post__in',
    'post__in' => explode( ',', $footer_id ),
    'post_type' => 'haru_footer',
    'post_status' => 'publish'
    );
    
    $posts = get_posts( $args );
    $post = $posts[0];
    
    echo render_post_builder( do_shortcode( $post->post_content ), $post);
    
    function render_page_content( $post_id ) {
    if ( class_exists( 'Elementor\Core\Files\CSS\Post' ) ) {
    $css_file = new Elementor\Core\Files\CSS\Post( $post_id );
    $css_file->enqueue();
    }
    
    return Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $post_id );
    }
    
    function render_post_builder( $html, $post ) {
    if ( ! empty($post) && ! empty( $post->ID ) ) {
    return render_page_content( $post->ID );
    }
    
    return $html;
    }

    Hope this helps!

     

    ****
    Regards,

    HaruTheme

    • This topic was modified 3 months ago by admin.
    • This topic was modified 3 months ago by admin.
    • This topic was modified 3 months ago by admin.
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.