在WordPress中找到涉及的功能
我正在看别人开发的网站。我们正在使用一个儿童主题,该主题回到了许多父母的功能。大约有二十个插件。在某个地方,有一个错误,它阻止主题设置传播到渲染页面。问题是,我不确定涉及什么。
我已经尝试启用wp_debug,但是页面相当无声。我已经将HTML评论插入了我认为会参与的功能和模板中,但是我还没有找到实际涉及的功能。
是否有插件或某种方法可以强制WordPress记录每个页面加载的文件/功能?您将如何处理这种情况?
I'm looking at a site someone else developed. We're using a child theme that is calling back to a lot of its parent's functions. There are about two dozen plugins. Somewhere in there is a bug that's preventing a theme setting from propagating to the rendered page. The problem is, I am not sure what's involved.
I've tried enabling wp_debug, but the page is fairly silent. I've inserted HTML comments into functions and templates that I thought would be involved, but I haven't found one that is actually involved.
Is there a plugin or some way to force WordPress to log every file/function that's loaded for a page? How would you approach this scenario?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能不是最好的答案,但是我在拥有WordPress网站的一些客户上处理了许多类似情况。
我通常在本地下载数据库和网站,并使用
要跟踪错误,我回荡一些助手功能也将打印挂钩信息。
如果达到孩子主题的代码,这是一个很好的开始。如果您的网站以父为主题呈现,则可以专注于孩子主题的挂钩并打电话,希望您会发现错误。
您确实必须咬着子弹并遵循链条。如果您的父主题呈现任何内容,您应该能够逐步评论您的孩子主题,以查明问题的原因。
This is probably not the best answer, but I've dealt with a lot of similar situations on some of my customers who own WordPress websites.
I usually download the database and website locally and setup a local website using LocalWP, but you can use any web server like XAMPP or WAMP, actually. In the end, this is helpful, because I can quickly find apply functions of my hooks by doing a full-text search on the project.
To track down the error, I echo some logging with a helper function which will also print hook information.
If the code of your child theme is reached, this is a good start. If your website renders with the parent theme, you can focus on the hooks and calls in your child theme and hopefully you will find the error.
You really have to bite the bullet and follow the chain. If your parent theme renders anything you should be able to comment your child theme step by step to pinpoint the cause of the problem.