New Landing How can we help? Cardinal Custom loop (php page template) doesn't support Page Builder Shortcodes

Viewing 4 posts - 1 through 4 (of 4 total)
  • Posted in: Cardinal
  • #126532
    gircat
    Member
    Post count: 16

    Hello,

    I’m implementing a custom WP loop for one page template. The loop works fine but the posts displayed in the loop doesn’t support the Page Builder Shortcodes. The loop is as follows. Please, can you advice how to enable them?

    Thanks a lot,

    
        $args = array('post_type' => 'post', 'paged'=> $paged);
        $loop = new WP_Query( $args );
       
        if ($loop->have_posts()){   
            ?>
           
            <div class="col-md-12 ">   
                <div class="row clearfix">
                       
                    <?php
                        while ( $loop->have_posts() ) : $loop->the_post();
                       
                            $categories = get_the_category();
                            $category_slug = $categories[0]->slug;
                            $category_name = $categories[0]->name;
                    ?>
                                <div class="col-md-4 col-sm-4">   
                                            <a>">
                                                <?php
    
                                                if(has_post_thumbnail()){
    
                                                    the_post_thumbnail('full'); ?>
    
                                                    <?php
                                               
                                                }else{
                                               
                                             }
                                            </a>
                                        </div>
                                        <h4>   
                                            <a>">
                                                <span><?php echo $category_name; ?></span><br/><?php the_title(); ?>
                                            </a>
                                        </h4>
                               
                                        <div class="entry-content">
                                            
                                                <?php
                                                if(!$post->post_excerpt) {               
                                                    $content = get_the_content();
                                                    $trim_content = wp_trim_words( $content, 25, '... <a href="' . get_permalink() . '"><span class="glyphicon glyphicon-plus-sign"></span></a>' );
                                                    echo '<span class="la-data">' . the_time('j/m/Y') . ' - </span>';
                                                    echo $trim_content;
                                                    } else {
                                                    $excerpt = get_the_excerpt();
                                                    $trim_excerpt = wp_trim_words( $excerpt, 25, '... <a href="' . get_permalink() . '"><span class="glyphicon glyphicon-plus-sign"></span></a>' );
                                                    echo '<span class="la-data">' . the_time('j/m/Y') . '</span>';
                                                    echo $trim_excerpt;
                                                    }
                                                ?>
                                            
    
                                        </div>
                                    </div>
       
                                </div>
                           
                        <?php endwhile; ?>
    #126693
    laranz – SUPPORT
    Member
    Post count: 3186

    Hi,

    Did you load the headers in the custom template, because the shortcodes needs the theme’s stylesheet to get its appropirate styles. Is this the full code or you just copy a snippet? If so can you give us a full code, and also a working example page of your Custom Template.

    Let us know,

    Thanks,
    laranz.

    #127269
    gircat
    Member
    Post count: 16

    Hello,

    I worked that out.
    Used “sf_content();” instead of “content()”.

    Can close the topic.
    R.

    #127271
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Great.
    -Rui

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register