WordPress erro PHP recebendo posts de outro blog wordpress

Estou usando este código na página template-blog.php do meu site, para obter postagens do meu primeiro blog do WP para o segundo blog do WP, diferentes sites usando as mesmas postagens de blog.

Este código funciona muito bem há anos, mas de repente ele parou de funcionar, me dando um argumento inválido na linha 133

 <?php /* $url = 'https://www.firstwp.com/wp-json/posts/'; $response = wp_safe_remote_get( $url ); if ( ! is_wp_error( $response ) ) { $remote_post = json_decode( wp_remote_retrieve_body( $response ) ); echo "
"; print_r($remote_post[0]); echo "

"; } */ ?>

<?php /* $get_car= "https://www.firstwp.com/wp-json/posts"; $cars_json = file_get_contents($get_car); $cars_array = json_decode($cars_json, true); echo "

"; print_r($cars_array); echo "

"; $response = wp_remote_get( $get_car ); $rows = wp_remote_retrieve_body( $response ) ; $decode = json_decode(stripslashes($rows), true); print_r($decode); */ // echo do_shortcode('[wpapi-posts s="WP-API" url="https://www.firstwp.com/wp-json/posts" posts_per_page="5"]'); ?> 'post', 'posts_per_page' =>0 ); query_posts( $args ); ?> <article id="post-" >

<a href="https://wordpress.stackexchange.com//questions/291075/wordpress-php-error-getting-posts-from-another-wordpress-blog/" title="" rel="bookmark">

<a href="https://wordpress.stackexchange.com//questions/291075/wordpress-php-error-getting-posts-from-another-wordpress-blog/" title="" rel="bookmark">

<!--

-->

<a href="https://wordpress.stackexchange.com//questions/291075/wordpress-php-error-getting-posts-from-another-wordpress-blog/"><img alt="" border="0" src="https://wordpress.stackexchange.com//questions/291075/wordpress-php-error-getting-posts-from-another-wordpress-blog//images/more.jpg">

<?php printf( __( 'Posted in %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list ); $show_sep = true; ?> | <?php comments_popup_link( '' . __( 'Leave a reply', 'twentyeleven' ) . '', __( '1 Reply', 'twentyeleven' ), __( '% Replies', 'twentyeleven' ) ); ?>

<!-- #post- --> <?php // $url = 'https://www.firstwp.com/wp-json/wp/v2/posts/'; $url = 'https://www.firstwp.com/wp-json/posts/'; $response = wp_safe_remote_get( $url ); if ( ! is_wp_error( $response ) ) { $remote_post = json_decode( wp_remote_retrieve_body( $response ) ); //echo "

"; //print_r($remote_post[0]); //echo "

"; //echo '

link ) . '">' . esc_html( $remote_post[0]->title ) . '

'; //remote post's content //echo '

' . wp_kses_post( $remote_post[0]->content ) . '

'; ?>

<a href="https://wordpress.stackexchange.com//questions/291075/wordpress-php-error-getting-posts-from-another-wordpress-blog/link ); ?>" title="Permalink to Hello world!" rel="bookmark" target="_blank">title ); ?>

<?php echo '

' . wp_kses_post( $remote_single_post->content ) . '

'; ?>

<a href="https://wordpress.stackexchange.com//questions/291075/wordpress-php-error-getting-posts-from-another-wordpress-blog/link ); ?>" target="_blank"><img alt="" border="0" src="https://wordpress.stackexchange.com//questions/291075/wordpress-php-error-getting-posts-from-another-wordpress-blog//images/more.jpg">

Posted in terms->category as $api_category){ ?> <a href="https://wordpress.stackexchange.com//questions/291075/wordpress-php-error-getting-posts-from-another-wordpress-blog/link)?>" rel="category tag" target="_blank">https://wordpress.stackexchange.com//questions/291075/wordpress-php-error-getting-posts-from-another-wordpress-blog/name)?>,

$(document).ready( function (){ $('.api_content').each( function(){ $(this).find( "p, h1 ,ol , ul, h2" ).not("p:lt(3)").remove(); }); //alert(apiImage); //$( ".api_content" ).find( "p" ).empty();; }); //$( ".api_content" ).contents().find( "img" ).css( "border", "10px solid #000;" );

<?php //get_sidebar(); get_footer();

Isso dá um erro nesta parte

  <?php // $url = 'https://www.firstwp.com/wp-json/wp/v2/posts/'; $url = 'https://www.firstwp.com/wp-json/posts/'; $response = wp_safe_remote_get( $url ); if ( ! is_wp_error( $response ) ) { $remote_post = json_decode( wp_remote_retrieve_body( $response ) ); //echo "
"; //print_r($remote_post[0]); //echo "

"; //echo '

link ) . '">' . esc_html( $remote_post[0]->title ) . '

'; //remote post's content //echo '

' . wp_kses_post( $remote_post[0]->content ) . '

'; ?>

<a href="https://wordpress.stackexchange.com//questions/291075/wordpress-php-error-getting-posts-from-another-wordpress-blog/link ); ?>" title="Permalink to Hello world!" rel="bookmark" target="_blank">title ); ?>

<?php echo '

' . wp_kses_post( $remote_single_post->content ) . '

'; ?>

<a href="https://wordpress.stackexchange.com//questions/291075/wordpress-php-error-getting-posts-from-another-wordpress-blog/link ); ?>" target="_blank"><img alt="" border="0" src="https://wordpress.stackexchange.com//questions/291075/wordpress-php-error-getting-posts-from-another-wordpress-blog//images/more.jpg">

Posted in terms->category as $api_category){ ?> <a href="https://wordpress.stackexchange.com//questions/291075/wordpress-php-error-getting-posts-from-another-wordpress-blog/link)?>" rel="category tag" target="_blank">https://wordpress.stackexchange.com//questions/291075/wordpress-php-error-getting-posts-from-another-wordpress-blog/name)?>,

Eu não tenho certeza do que está causando o problema é que ele está funcionando bem há anos agora, então qualquer ajuda seria apreciada. A idéia é que eu tenho 2 sites com conteúdo diferente e quero que a página do blog mostre o mesmo conteúdo que Posso publicar no FIRSTWP e mostrar isso no SecondWP

Eu tentei o plugin FeedWordPress, mas não mostra a imagem no trecho da página de postagens

Solutions Collecting From Web of "WordPress erro PHP recebendo posts de outro blog wordpress"