• I’m wondering if there is an alternative way to add some CSS or JS code to a theme installed on my website except creating a child-theme ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    You can add CSS via the Customizer under “Additional CSS. To enqueue js without a child theme, you could always write a simple plugin — essentially, the code you’d put in functions.php of a theme, but wrap it as a plugin.

    Thread Starter mdev1

    (@mdev1)

    The plugin method seems great , I have created a folder with the plugin name and inside it I created a PHP file , I added the information at the top then defined( 'ABSPATH' ) or die(); , Should I just start writing the code directly or I should use a hook or a specific builtin function ?

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    This is my “utility” plugin. One of the things it does is enqueue some JS for a popup. Feel free to glean what you can from it.

    https://github.com/sterndata/sdsplugin

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Is there is a way to add CSS or JS code to a theme without creating a child?’ is closed to new replies.