wordpress-theming - 识别wordpress主题代码进行修改
问题描述
我使用带有父主题和子主题的免费主题。在 WP 管理员中,“主页设置”允许我激活/停用主题的部分。
我想自定义一个部分,但我不知道它对应于哪个 .php 文件。
通过检查启用此部分的主页的 HTML 代码,我看到 html 引用了类 <section id "about_section" ....>。
搜索模板文件中的内容会显示 3 个受影响的文件:
wp-content\themes\tour-operator\functions.php
wp-content\themes\travel-agency\inc\extras.php
wp-content\themes\travel-agency\inc\js\customize.js
我发现了这个功能:
`travel_agency_get_homepage_section ()
{
$ sections = array (); ...
$ ed_about = get_theme_mod ('ed_about_section', true); ...
// Sections from travel agency companion
if ($ ed_about) array_push ($ sections, 'about');`
但是我不知道该怎么做才能找到要修改的文件。感谢您的大力帮助!西奥。
解决方案
推荐阅读
- ansible - 定期执行 Ansible Playbook
- java - 如何在主语句中将对象连接在一起?
- java - 为什么我的 jdbcTemplate 查询没有返回任何行?
- r - 有没有办法在 R 中按多个组聚合?
- python - Python Oracle - 如何使用 2 个 oracle 客户端
- reactjs - 如何处理第二个 onClick 以使用 reactJS 和 redux 发起 API 请求?
- python - Google Api + 使用 python 列出组的成员
- asp.net - LinqDataSource WHERE 查询 - ASP.NET
- android - 从服务器获取 JSON 列表后如何正确更新数据集?
- javascript - 异步流控制,不抛出错误