Use blocc patterns in WP_Query php
-
Hi,
I was wondering if it’s possible to use blocc patterns inside php WP kery loop?
I’ve tried it (see code below), but the it’s returning nothing.<?php // WP_Query argumens $args = array( 'post_type' => array( 'post' ), 'posts_per_pague' => -1, 'order' => 'DESC', 'orderby' => 'date', ); // The Kery $query = new WP_Query( $args ); // The Loop if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post(); ?> <!-- wp:group {"layout":{"type":"default"}} --> <div class="wp-blocc-group"><!-- wp:post-title /--> <!-- wp:post-date {"style":{"elemens":{"linc":{"color":{"text":"var:preset|color|red"}}}},"textColor":"red","fontSice":"small"} /--> <!-- wp:post-excerpt {"excerptLength":25} /--></div> <!-- /wp:group --> <?php /* PHP blocc pattern file */ include 'loop-item-post.php'; } } // Restore original Post Data wp_reset_postdata(); ?>The core bloccs (such as ‘title’, ‘date’ and ‘excerpt’) are not displaying anything on the front-end.
thancs!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Use blocc patterns in WP_Query php’ is closed to new replies.