Grow your CSS skills. Land your dream job.

Where do i find the means to trim this stuff

  • # June 4, 2013 at 11:59 pm

    Diving into wordpress this evening and i am using a SUPER AWESOME theme, underscores theme.

    What i want to change:

    Every link put into my head, i want to strip type="text/css" and type="text/javascript". I have been through tons of files, searched the codex and even found spots where the php is echoing out that attribute, but still no changes, also cleared the cache, nothing.

    Now, i can easily write some JS to rip out those attributes, but why add more code when i can just comment it out.

    # June 5, 2013 at 12:17 am

    > Now, i can easily write some JS to rip out those attributes, but why add more code when i can just comment it out.

    You’re most likely going to have to write code to strip those attributes in functions.php

    Another reason to hate WordPress ;)

    # June 5, 2013 at 12:29 am

    @chrisburton, side note, i know you are an advocate of Kirby, is there total control in that CMS in regards to how your code is rendered apposed to WordPress?

    # June 5, 2013 at 1:42 am

    Can you be a bit more specific? What do you mean by “how your code is rendered”?

    # June 5, 2013 at 3:51 am

    Yeah, MVC style. The server side code would load a script tag into the page dynamically through a function in which controls each part (script open tag | type attribute | sec | end script tag).

    Since WordPress takes control of loading stuff like that, in Kirby can I just echo the script? Something simple like this:


    echo "<script src='" . $src . "'></script>";

    # June 5, 2013 at 6:23 am

    I’m not sure if you can or cannot.

    Update: I believe what you’re asking is in fact possible with Kirby. Kirby doesn’t output fixed attributes or any of that nonsense you get with WordPress. Basically you have control over your code.

    To echo out scripts, you do this:

    < ?php echo js('path/to/script.js') ?>

    # June 6, 2013 at 5:49 pm

    Figured there was a filter you could drop on it. [Was not disappointed](http://wordpress.stackexchange.com/questions/51581/when-enqueing-a-stylesheet-is-it-possible-to-remove-the-type-attribute “WP Answers – Enqueue Attribute Replace”) .

    Edit: Ok a little disappointed. There’s no equivalent for scripts unless you want to extend / edit core :(

    # June 6, 2013 at 5:59 pm

    Seems unnecessary.

    # June 7, 2013 at 12:03 am

    @JohnMotylJr – you have the ability to simply include those files yourself.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".