JSON error if templates loads the_excerpt();
-
Hello
Im using block lab to create contet, so far, so good.
But in one block template i use this PHP:`$categoria = block_value( ‘fichaspelis’ );
$post_number = block_value( ‘cantidad’ );
$paged = (get_query_var( ‘paged’ )) ? get_query_var( ‘paged’ ) : 1;
$args = array(
‘post_type’ => ‘post’,
‘post_status’ => ‘publish’,
‘category_name’ => $categoria,
‘posts_per_page’ => $post_number,
‘paged’ => $paged,
);
$arr_posts = new WP_Query( $args );if ( $arr_posts->have_posts() ) :
while ( $arr_posts->have_posts() ) :
$arr_posts->the_post();
?>Then in one div, I call “the_excerpt();”, and after that, JSON error shows in the block editor, impossible to see results in the front end, because it wont save the page.
I realized that if i take away “the_excerpt()”, the block and the front page, works perfect, but of course, without the post’s excerpt, wich by the way its called from a “trim_excerpt” function that uses “the_content” to generate the “fake” excerpt.
WHat can I do??
THank you!
- The topic ‘JSON error if templates loads the_excerpt();’ is closed to new replies.