小编dow*_*337的帖子

如何将小部件添加到wordpress中的header.php?

我安装了一个名为的插件Translator Box,我使用它的短代码并将其放入我的wordpress主题header.php.

 [translation_box languages="english,russian,german,spanish,french,chinese" width="100%" height="200px" bgcolor="white" txtcolor="#000000"]
Run Code Online (Sandbox Code Playgroud)

但是不起作用!

它还在窗口小部件的"已启用"窗口小部件中生成窗口小部件.有没有办法在header.php中使用一些可以调用小部件的代码?谢谢.

wordpress wordpress-plugin

7
推荐指数
2
解决办法
3万
查看次数

为什么the_content在wordpress single.php中不起作用

我的代码:

<?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?> 
        <div class="posts" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
            <h2> 
              <?php the_title(); ?>
            </h2>
            <div class="entry">
                <?php the_content();?>
            </div>                  
        </div><!--post end-->
    <?php endwhile; ?>
<?php else : ?>
    <h3>no content</h3>
<?php endif; ?>
Run Code Online (Sandbox Code Playgroud)

我将代码放入我自定义的wordpress主题文件single.php中.为什么它不能输出帖子内容,它可以输出帖子标题.谢谢.

wordpress wordpress-theming

1
推荐指数
1
解决办法
4254
查看次数