Use Shortcode inside Template
-
Hello,
New to wordpress and PHP.
How do I wrap this shortcode around some HTML/PHP? I’ve tried using the do_shortcode but that didn’t work.
<?php echo do_shortcode( [timed-content-rule id="101"] ) ?> <?php echo do_shortcode( [/timed-content-rule] ) ?>
PHP/HTML
<?php $rows = get_field('breakfast'); $row_count = count($rows); $i = rand(0, $row_count - 1); ?> <h1> <?php echo $rows[ $i ]['dish_name']; ?> </h1> <p> <?php echo $rows[ $i ]['dish_description']; ?> </p> <h3> Served<span><?php echo $rows[ $i ]['time_served']; ?></span> </h3>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Use Shortcode inside Template’ is closed to new replies.