Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WordPress图像路径/链接已更改或断开_Wordpress_Image_Wordpress Theming_Filepath - Fatal编程技术网

WordPress图像路径/链接已更改或断开

WordPress图像路径/链接已更改或断开,wordpress,image,wordpress-theming,filepath,Wordpress,Image,Wordpress Theming,Filepath,这是我通过“添加媒体”按钮上载图像时的代码 <p><a href="http://bebe15594.staging-cloud.partnerconsole.net/wp-content/uploads/Brains-like-a-pack-of-cards-Card-Placeholder.png"><img class="alignleft wp-image-197 size-full" src="http://bebe15594.staging-cloud.

这是我通过“添加媒体”按钮上载图像时的代码

<p><a href="http://bebe15594.staging-cloud.partnerconsole.net/wp-content/uploads/Brains-like-a-pack-of-cards-Card-Placeholder.png"><img class="alignleft wp-image-197 size-full" src="http://bebe15594.staging-cloud.partnerconsole.net/wp-content/uploads/Brains-like-a-pack-of-cards-Card-Placeholder.png" alt="Brains like a pack of cards - Card Placeholder" width="470" height="663" /></a></p>
但当我将上述代码更改保存/更新到

<p><a href="\&quot;http://bebe15594.staging-cloud.partnerconsole.net/wp-content/uploads/Brains-like-a-pack-of-cards-Card-Placeholder.png\&quot;"><img class="\&quot;alignleft" src="\&quot;http://bebe15594.staging-cloud.partnerconsole.net/wp-content/uploads/Brains-like-a-pack-of-cards-Card-Placeholder.png\&quot;" alt="\&quot;Brains" width="\&quot;470\&quot;" height="\&quot;663\&quot;" /></a></p>
谁能告诉我为什么会这样?
如何解决此问题???

将此代码添加到functions.php文件:

 function wpse72941_content_filter( $content ) {
   $new_content = '';
   foreach( preg_split( '/((\r?\n)|(\r\n?))/', $content ) as $line ) {
   $new_content .= preg_replace( '/^&gt;/', '>', $line ) . '\r\n';
   }
   return $new_content;
 }
 add_filter( 'the_content', 'wpse72941_content_filter', 1 );

您不指定代码行的位置,即自定义模板、正常的“添加帖子”页面等。如果是自定义模板,请添加wp_打印_脚本“媒体上传”;在创建自己的脚本之前,以及在创建脚本“jquery”之后;。这是假设您正在使用wp_编辑器上载图像