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 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化