dsdvr06648 2015-12-27 00:01
浏览 84
已采纳

在Wordpress子主题中更改类/ id

I am currently changing a parent theme in wordpress by creating a child theme and I am just checking if this is considered bad form and if it will have any repercussions if/when the theme is updated.

e.g. The parent theme's header.php has an id called #menu. This has a lot of styles in the parent's style.css file. To avoid having to alter everything to do with the #menu I changed the id to #menu-child in the child theme's header.php file and added my own styles, this has made it a lot quicker but I'm unsure if it will screw the styles/theme up if/when it is updated.

Thanks in advance.

  • 写回答

1条回答

  • duanmiao6695 2015-12-27 00:08
    关注

    Short answer: No.

    Your child theme template overwrites the main theme template and still does that after an update. So your changes will stay in place. But if the parent theme uses the #menu for stuff (styling, js...) these changes and current adjustments will not have any effect in your child theme anymore. So if you want your own changes and all functionalities and styling of the parent theme you should not remove the id, but add your own class. Of cause theme developers can sometimes mess up the structure or make changes themselves which require you to alter your child theme templates as well (like changing the whole structure).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器