Using MCB in a WP_Query
-
Hi Folks, thanks for your great work! Is there a way to ‘create’ a block through a WP_Query ?
<?php $the_query = new WP_Query('pagename=parent/child'); ?> <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <h2 class="feelings__title"><?php the_title(); ?></h2> <?php the_block( 'Name of the block' ) ?> <?php endwhile; wp_reset_postdata(); ?>
Thanks for your help !
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Using MCB in a WP_Query’ is closed to new replies.