[英]Editing WordPress Site Locally
I have created a WordPress site, which is saved on localhost and have been editing elements of my site, such as font color etc in 'Customiser' on WordPress. 我创建了一个WordPress网站,该网站保存在localhost上,并且正在编辑我网站的元素,例如WordPress上“ Customiser”中的字体颜色等。 However, it has become clear that you are restricted when editing this way. 但是,很明显,以这种方式进行编辑时会受到限制。 I am also used to creating pure HTML sites, so would rather edit the code locally. 我也习惯于创建纯HTML网站,因此宁愿在本地编辑代码。
I have all of the files I need downloaded and have started to edit the style.css but my question is, what is the best way to go about editing the php files and finding what you want? 我已经下载了所有文件,已经开始编辑style.css,但是我的问题是,编辑php文件并找到所需文件的最佳方法是什么?
For example: I know that if I go to 'footer.php', this is where I would edit the footer content. 例如:我知道如果我转到“ footer.php”,则可以在其中编辑页脚内容。 Is there a general way of knowing which section will be found in which PHP file, possibly using 'inspect elements'? 是否有一种通用的方法可以知道使用哪个“检查元素”在哪个PHP文件中找到哪个部分?
I know it is a broad question, but any advice when it comes to local WordPress sites would be appreciated. 我知道这是一个广泛的问题,但是有关本地WordPress网站的任何建议将不胜感激。 There does not appear to be much info out there about how to edit once you have made your WP site local. 将WP站点设置为本地后,关于如何进行编辑的信息似乎并不多。
The question is very broad, but I will do my best to answer. 这个问题很广泛,但是我会尽力回答。 You mentioned there not being much out there when it comes to editing WP locally. 您提到在本地编辑WP时没有很多。 I want to point out that there is a huge WP community online and that you can refer to the WordPress Codex for most answers. 我想指出,在线上有一个庞大的WP社区,您可以参考WordPress Codex获得大多数答案。 With that said, you can create custom page templates fairly easy. 话虽如此,您可以轻松创建自定义页面模板。 This will allow you to completely control the structure of the content. 这将使您可以完全控制内容的结构。 All of the documentation is located here: https://developer.wordpress.org/themes/template-files-section/page-template-files/#creating-custom-page-templates-for-global-use For existing sections of your site, you will need to just explore the files to get an idea of where everything is, as themes can vary in the way they are laid out. 所有文档都位于此处: https : //developer.wordpress.org/themes/template-files-section/page-template-files/#creating-custom-page-templates-for-global-use适用于您的站点,您将只需要浏览文件就可以了解所有内容,因为主题的布局方式可能会有所不同。 Unfortunately, I will not be able to help you more without more details. 不幸的是,如果没有更多细节,我将无法为您提供更多帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.