我需要在wordpress中执行我的个人php代码来打印mysql数据库中的数据。我只能在页面上执行。
我的想法是创建一个文件页pagename。php,复制页面主体。php模板并更改此代码:
<?php while ( have_posts() ): the_post(); ?>
        <article <?php post_class(\'group\'); ?>>
            <?php get_template_part(\'inc/page-image\'); ?>
            <div class="entry themeform">
                <?php the_content(); ?>
                <div class="clear"></div>
            </div><!--/.entry-->
        </article>
        <?php if ( ot_get_option(\'page-comments\') == \'on\' ) { comments_template(\'/comments.php\',true); } ?>
    <?php endwhile; ?>
 使用我的个人php代码。
我尝试过这样做,似乎一切都很好,但我想从您的经验中知道这是否会导致任何错误。
谢谢