如何把自己的HTML到WordPress的主题? [英] How to put own HTML into Wordpress theme?

查看:108
本文介绍了如何把自己的HTML到WordPress的主题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了一个Wordpress主题,但我需要在那里放置自己的HTML代码。
所以,我想我会进入: wp-content / themes / theme_name / header.php ,并且在需要的地方插入需要的HTML代码。

我做了它,但它并没有影响网站 - 新增HTML元素没有在网站上看到。
我无视任何内容吗?或者需要在WP管理部门设置一些东西?
或缓存问题?



对不起,也许是一个愚蠢的问题,我只是第一次玩WP。

解决方案

您的博客页面是从不同的主题部分创建的。 header.php 就是其中之一。它会创建页面的标题。通常,在输出大多数HTML之前。 footer.php 用于页面的页脚。
如果你想让你的HTML代码只进入主页,请使用index.php(它调用 header.php footer.php )。如果你想让你的代码在页面中显示,使用 page.php 。如果您希望在查看帖子时显示代码,请使用 single.php 。希望这有助于。


I installed a Wordpress theme, but I would need to put there my own HTML code. So, I would suppose I'll go into: wp-content/themes/theme_name/header.php and on the needed place I inserted needed HTML code.

I did it, but it didn't affect the website - the newly put HTML elements are not seen in the website. Do I disregard anything? Or is needed to set up something in the WP administration? Or problem with cache?

Sorry, maybe a stupid queston, I am just playing with WP for the first time.

解决方案

The pages of your blog are created from different theme "parts". header.php is one of them. it creates the header of the page. Usually, before most HTML is output. footer.php is used for the footer of the page. If you want your HTML code to go in the homepage only, use index.php (which calls header.php and footer.php). If you want your code to show in a page, use page.php. If you want your code to show when viewing a post, use single.php. Hope this helps.

这篇关于如何把自己的HTML到WordPress的主题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆