简体   繁体   English

如何修改WordPress主题

[英]How to modify wordpress theme

I have modify the file wordpress/wp-content/themes/mythemes/index.php, added some word. 我修改了文件wordpress / wp-content / themes / mythemes / index.php,添加了一些单词。 But when I reflush the main page, these word didn`t show up. 但是当我重新刷新主页时,这些词没有出现。 I even delete the whole code of index.php & home.php. 我什至删除了index.php和home.php的整个代码。 But the main page still show up. 但是主页仍然显示。 I am sure I modify under the correct theme folder. 我确定我在正确的主题文件夹下进行了修改。 Anyone know what happen? 有人知道会发生什么吗?

Wordpress theme structure is very flexible but there are some default page templates that must be inside your theme folder: WP Them files Wordpress主题结构非常灵活,但是主题文件夹中必须包含一些默认页面模板: WP Them files

index.php in the theme folder will be called only if the files above him in the hierarchy were not called: 仅当未调用层次结构中位于其上方的文件时,才会调用主题文件夹中的index.php:

WP Template Hierarchy WP模板层次结构

You should follow the instructions in the link I think you should start with creating a page template, then create a page in wp-admin panel, on the side choose the page template you created before, and in that page template you can write your code/text, please note you should write the text in the wp-admin editor so you wont have to modify the template for every text modification: 您应该按照链接中的说明进行操作,我认为您应该从创建页面模板开始,然后在wp-admin面板中创建页面,在一侧选择您之前创建的页面模板,然后在该页面模板中编写代码/ text,请注意,您应该在wp-admin编辑器中编写文本,这样您就不必为每次文本修改都修改模板:

here is some toturial of how to create a wordpress page template: page template wrodpress 这是有关如何创建wordpress页面模板的一些介绍: 页面模板wrodpress

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM