Digital experiences for all disciplines
New Landing › How can we help? › Cardinal › Custom loop (php page template) doesn't support Page Builder Shortcodes
New Landing › How can we help? › Cardinal › Custom loop (php page template) doesn't support Page Builder Shortcodes
- This topic has 3 replies, 3 voices, and was last updated 10 years by Rui Guerreiro – SUPPORT.
-
Posted in: Cardinal
-
November 7, 2014 at 4:10 pm #126532
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; ?>
November 9, 2014 at 8:31 am #126693Hi,
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.November 11, 2014 at 11:27 am #127269Hello,
I worked that out.
Used “sf_content();” instead of “content()”.Can close the topic.
R.November 11, 2014 at 11:29 am #127271Great.
-Rui -
Posted in: Cardinal
You must be logged in and have valid license to reply to this topic.