首页 > 解决方案 > 识别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');`

但是我不知道该怎么做才能找到要修改的文件。感谢您的大力帮助!西奥。

标签: wordpress-theming

解决方案


推荐阅读