在wordpress帖子中使用PHP

在wordpress帖子中使用PHP,php,Php,我使用一个名为:wp exec php的wordpress插件在我的wordpress页面中执行php 通常情况下,对于一些简单的事情,比如在页面上显示时间和内容,这是非常完美的 但是在这个项目中,我需要运行一个查询,列出一些类似这样的帖子: 当我把查询放在页面中时,它工作正常!但是当als在页面上放置一些文本时。它不显示文本 这是page.php--> 我希望你能帮我做这件事 编辑:从pastebin复制的代码 <?php get_header(); ?> <!--BEGI

我使用一个名为:wp exec php的wordpress插件在我的wordpress页面中执行php

通常情况下,对于一些简单的事情,比如在页面上显示时间和内容,这是非常完美的

但是在这个项目中,我需要运行一个查询,列出一些类似这样的帖子:

当我把查询放在页面中时,它工作正常!但是当als在页面上放置一些文本时。它不显示文本

这是page.php-->

我希望你能帮我做这件事

编辑:从pastebin复制的代码

<?php get_header();
 ?>
<!--BEGIN #content -->
                <div id="content-side">
                        <!--BEGIN #primary -->
                        <div id="primary" >

      <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

      <?php if (isset($options['breadcrumb_display']) && $options['breadcrumb_display']=='1'){ ?>
      <div id="breadcrumb"><?php echo the_breadcrumb(); ?></div>
      <?php } ?>


                        <h1 class="page-title">
                                <?php   the_title(); ?>
      </h1>

        <!--BEGIN .hentry -->
                                <div <?php post_class() ?> id="post-<?php the_ID(); ?>">

                        <?php if ( current_user_can( 'edit_post', $post->ID ) ): ?>
                    <!--BEGIN .entry-meta .entry-header-->
                                        <div class="entry-meta entry-header">
                                                <?php edit_post_link( __('edit', 'simple'), '<span class="edit-post">[', ']</span>' ); ?>
                                        <!--END .entry-meta .entry-header-->
                    </div>
                    <?php endif; ?>

                                        <!--BEGIN .entry-content -->
                                        <div class="entry-content">

                                                <?php the_content(); ?>

                                        <!--END .entry-content -->
                                        </div>

                <!--END .hentry-->
                                </div>

                                <?php comments_template('', true);

         ?>

                                <?php endwhile; else: ?>

                                <!--BEGIN #post-0-->
                                <div id="post-0" <?php post_class() ?>>

                                        <h1 class="entry-title"><?php _e('Error 404 - Not Found', 'simple') ?></h1>

                                        <!--BEGIN .entry-content-->
                                        <div class="entry-content">
                                                <p><?php _e("Sorry, but you are looking for something that isn't here.", "simple") ?></p>
                                        <!--END .entry-content-->
                                        </div>

                                <!--END #post-0-->
                                </div>

                        <?php endif;
      wp_reset_query();
      ?>
                        <!--END #primary -->
                        </div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>


您好,很高兴您给了我们您的代码,但请尝试将其包含在问题中,以便人们不必点击和筛选其他网站。更好的是,只需包含导致问题的代码部分:)谢谢!好的,我将在功能中尝试这样做。但是我真的不知道是什么原因导致了这个错误,所以我决定发布整个代码。这不是你的发布代码这看起来像一个模板codeTrue,但是这个页面是由这个模板文件生成的:page.php,所以我想它一定与此有关。我在页面中使用的内容(例如)是:Text