Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/227.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
Php 不起作用<--更多-->;在wordpress中_Php_Wordpress - Fatal编程技术网

Php 不起作用<--更多-->;在wordpress中

Php 不起作用<--更多-->;在wordpress中,php,wordpress,Php,Wordpress,我尝试在WP中使用,但它不起作用。我正在使用 Wordpress 3.6.1。有什么问题 帖子的编校者中的文本: Abc<!--more-->cba Abccba 我如何使用: <?php $args = array( 'posts_per_page' => 10, 'order'=> 'ASC', 'orderby' => 'title' ); $postslist = get_posts( $args ); foreach ($pos

我尝试在WP中使用
,但它不起作用。我正在使用 Wordpress 3.6.1。有什么问题

帖子的编校者中的文本:

     Abc<!--more-->cba
Abccba
我如何使用:

<?php
$args = array( 'posts_per_page' => 10, 'order'=> 'ASC', 'orderby' => 'title' );  
$postslist = get_posts( $args );  
foreach ($postslist as $post) :  setup_postdata($post); ?>  
    <div>  
    <?php the_date(); ?>  
    <br />  
    <?php the_title(); ?>  
    <?php the_excerpt(); ?>
    <?php the_content(); ?>  
    </div>  
<?php endforeach; ?> 



我还没有使用redactor插件(你说的是redactor插件吗?)

刚刚测试过,如果您将
添加到编辑器中,那么wp 3.6.1肯定会删除注释并将其替换为
标记,但只有在从前端查看帖子时才会这样做,所以它仍然以
的形式保存在db中,这很有趣

在wp 3.5.2中,这并没有发生在我身上。顺便说一下,当我尝试这个测试时,我没有使用redactor


这就是你的意思吗

试着在cba之后移动它,或者在它们之间留出一个空格。我想知道这是否是一个安置问题。你有
global$post在此代码之前的某个位置声明?setup_postdata()需要将您传递的$post作为全局函数,以便其他函数正常工作。嗯,我在WP中没有使用html redactor,而是在WP中使用文本redactor。我该怎么办?给我一个链接到
文本编辑
,我找不到任何相关信息。可能尝试不同的wp版本,而不是使用3.6.1。许多插件没有经过最新wp版本的测试