Post loop and shortcodes
-
Hi,
Mayby I’m overlooking something, but it seems my custom post type loop doesn’t support the use of shortcodes. Here’s my php:
<?php $args = array( 'post_status' => 'publish', 'post_type' => 'sections', 'meta_key' => 'display_order', 'orderby' => 'meta_value_num', 'order' => 'ASC', 'showposts' => '50', ); $posts = get_posts($args); foreach($posts as $post): ?> <section class='segment-wrapper' style="background-color:<?php the_field('bgcolor'); ?>;color:<?php the_field('txcolor'); ?>;"> <div class='text-inside'> <?php echo ($post->post_content); ?> </div> </section> <?php endforeach; ?>So, this loop works fine except for the shortcodes used in the content of the returned posts.
Any suggestions? Thanks in advance.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Post loop and shortcodes’ is closed to new replies.