Wordpress,短代码不会在我制作的自定义主题中工作

时间:2012-09-07 13:22:43

标签: wordpress wordpress-plugin wordpress-theming

我已经开始学习如何为wordpress制作自定义主题,并在安装包含短代码的插件时遇到问题。我尝试添加一个短代码(通常是一个表单插件,我已经尝试过两个不同的代码,还有一个ecwid购物车,但没有短代码可以工作,是的,插件被激活),创建一个页面并使用visual / html编辑器。当我检查页面时它没有显示任何内容。这是我的single.php ..

<?php get_header(); ?>
  <body>
  <div id="maintopwrapper">
    <div class="container" id="topwrapper">
<div class="row">
<div class="span8">




 <?php while (have_posts()) : the_post(); ?>
<!-- Content Here -->

<div class="row"><div class="span8 greygrad round">
<div class="padding"><div class="content" style="margin-top:25px;"><?php the_content(); ?></div></div></div></div>

<div class="row margintop"><div class="span8 greygrad round">
<div class="padding">

<?php comments_template() ?>
</div></div></div>




<?php endwhile;?> 



</div>
<?php get_sidebar(); ?>


</div>
    </div>

    </div> <!-- end of maintop wrapper-->

<?php get_footer(); ?>

它应该显示,因为the_content()是否正确?如果您需要其他任何内容供我分享,请告诉我。插件我尝试了一个gravityforms,ecwid购物车和quforms ..所有的短代码都不起作用。我让其中一个工作的唯一方法是创建一个自定义页面主题并添加硬编码的php来调用该函数,但我更喜欢使用短代码,这样主题就可以被那些不编码的人使用。

对于实例:http://modernlogic.co/wp

菜单中的“联系”页面实际上是在自定义主题中硬编码的,而不是在菜单的“示例页面”中使用我想要的短代码

提前致谢

1 个答案:

答案 0 :(得分:0)

我是个白痴......我意识到我没有page.php,所以当我尝试将短代码添加到页面时,它引用了index.php而不是page.php(因为没有)所以它只显示摘录而不是内容。我想出了这个,因为我尝试将短代码添加到帖子中,所以当它转到single.php时,短代码工作,因为它有内容而不仅仅是摘录。哦,我想试验和错误..无论如何,谢谢你试图帮助我

相关问题