如何在wordpress(版本3.0)主题的页脚中添加侧边栏?
我想向 WordPress 主题添加侧边栏或小部件,我在网上尝试了很多尝试,但都失败了,因为它们已经过时了。我的网站链接在这里
I want to add sidebar in three column layout.
谢谢
I want to add sidebars or widgets to wordpress theme, I tried many tuts online but they failed because they are to outdated. My website link is here
I want to add sidebar in three column layout.
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如何在 WordPress 主题的页脚中添加侧边栏
步骤 1.
在functions.php 中注册侧边栏
步骤 2.
创建一个模板文件并将其命名为 sidebar-footer.php 并包含对您的主题的调用侧边栏
注意:出于样式目的,您应该将上述函数调用包装在 div 中我将其分为 3 个小部件区域,并使用 css 类“footer-left”、“footer-center”和“ footer-right"
您必须添加样式才能在 css 中显示它们。
示例:清除在此之前的所有浮动 div。
确保下一个 div 清除:both
步骤 3.
在 footer.php 或任何模板的底部添加
How to add a sidebar in the footer of a WordPress theme
Step 1.
Register your sidebars in functions.php
Step 2.
Create a template file and name it sidebar-footer.php and include the call to your sidebar
Note: for styling purposes you should wrap the above function call in a divI broke it into 3 widget areas for you with the css clases "footer-left", "footer-center", and "footer-right"
You will have to add the styles to display them in your css.
Example: clear any floated divs that come before this.
make sure the next div clears:both
Step 3.
In your footer.php or at the bottom of any of your templates add
codex 它并没有过时 http://codex.wordpress.org/Function_Reference/get_sidebar,这可能会有所帮助你。
codex it's not outdated http://codex.wordpress.org/Function_Reference/get_sidebar, this might help you.