3

I have developed a website using a fully fledged theme packed with tons of bloatware and custom functions/widgets I am not using. The package is slow, and 95% of CSS (1MB!!!!) and Javascript is never used by the child theme. This is why I am thinking about unlinking the child theme from the parent and promote the child theme as a standalone theme. However this requires "walking" through PHP code, scripts and CSS to verify what is being used before trimming.

What steps would you take, generally speaking, to achieve this?

  • This question is way too broad to answer. – cjbj Sep 22 '16 at 12:45
  • That's why I have wrote "generally speaking". The answer could simply be a few options like "debug php", "debug javascript" use a tool to cleanup unused CSS. Too difficult? ;-) – Riccardo Sep 22 '16 at 12:47
  • I've done this many times; start with "view source" of rendered HTML and then work backward from that, building a new theme by pulling whatever css, php files and functions from the parent as needed. I have not yet found a tool that will identify unreachable .css; that would be helpful. – C C Sep 22 '16 at 13:07
  • Thank you CC for spending two cents on this. Use your comments as a solution and I will select it. As for the CSS you could use Firefox add on dust me selector for this addons.mozilla.org/en-US/firefox/addon/dust-me-selectors. And thanks to Toscho that keeps downgrading my messages! Relax mate – Riccardo Sep 22 '16 at 13:29
  • C C's idea is similar to what I would suggest. Take the markup you have and build your theme fresh from scratch. – jdm2112 Sep 22 '16 at 13:54
0

Start with "view source" of rendered HTML and then work backward from that, building a new theme by pulling whatever css, php files and functions from the parent as needed.

(footnote - thank you for the pointer to the 'dust me' utility, I will check that out).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.