Use the following code to create a simple plugin. Create a directory tia
inside plugins
directory and save the code in a file tia.php
then put it inside tia
directory and finally activate from plugin page.
<?php
/**
* Plugin Name: Theme Independent Assets
* Author: Obi
* Version: 0.0.7
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
function tia_enqueue_scripts() {
wp_enqueue_script( ... );
wp_enqueue_style( ... );
}
add_action( 'wp_enqueue_scripts', 'tia_enqueue_scripts' );
Related Posts:
- Solutions for generating dynamic javascript / CSS
- Any alternate TinyMCE4 themes / subthemes?
- Whats the safest way to output custom JavaScript and Css code entered by the admin in the Theme Settings?
- How to add material design css in wordpress and woocommerce
- How to get javascript slider to work! [closed]
- How can I wrap all blog posts image with
- White screen when attaching css to function.php
- WordPress theme resource won’t load over VPN
- How to reuse parts of WordPress site e.g. header, footer, part of header for multiple WordPress sites?
- What is The Best Way to Make Parallax header effect for wordpress theme ?? pure CSS or using JavaScript? [closed]
- Does the functions.php file ever get called during an AJAX call? Debug AJAX
- How to add CSS class to custom logo?
- theme path in javascript file
- Proper, exhaustive documentation for wp.editor etc
- Trigger Customizer saving process with Javascript only
- Why max-width:97.5% on content images?
- add generated stylesheet from parent theme after child-themes style.css
- why does twenty eleven theme mix up the css measurement units?
- Setting up partial Right-to-Left admin interface
- Adding inline styles from a widget
- Can’t edit style.css in subdirectory of my theme?
- Adding dashicon fonts to the admin of pre 3.8 installs
- How to Handle CSS for Multiple Header header.php Files?
- Changing the entire control choices using wp.customize with JavaScript
- How to Change CSS Variable value in Theme Customizer Live Preview
- Move my theme style.css into a folder
- Enqueued Stylesheets Effecting Admin Styles
- There’s an image named g.gif somewhere in my WordPress site
- wp_head() not inserting the default stylesheet style.css
- How to highlight the current page in the nav menu?
- First completely customized theme, where should I start?
- WordPress Customizer Control with React
- WordPress 5.8 update problem custom theme styles are overridden by core styles common.min.css
- CSS won’t style output of wp_nav_menu() correctly
- Where is definied the theme location for the main menu in a WordPress template?
- How to correctly add JQuery in a WP theme?
- Is it necessary to prefix every css class in a theme framework?
- current-menu-item class not working
- Weekly background code not working
- Including Javascript options
- How do the default themes reference style.css?
- Multiple Page Templates & CSS
- JavaScript Change focus to password field login page being reset
- How to make Isotope and WordPress work together?
- Single page site with history.js
- Font Awesome 5 Free – far working but fas is not? [closed]
- How remove render blocking css from wordpress when you build a theme?
- How to: JQuery multiple wordpress media uploader buttons in the same options page?
- What is the meaning of WordPress’s recommended css classes and where are they applied?
- Redirect to another page using contact form 7? [closed]
- How to i style the elements from the TinyMCE
- My jQuery is enqueued properly. So why isn’t it working?
- Custom image size vs CSS sizing
- How to rotate every letter in a title
- Theming Using Bootstrap Glyphicons and WordPress Dashicons
- Broken theme, template is missing
- wp_enqueue_script not working?
- Having issue with WordPress wp_enqueue_style
- pass wordpress template directory into ajax url call
- How to style bootstrap container in wordpress theme?
- CSS added through customizer neglects the need of a child theme?
- How to override template files in parent theme?
- LESS not working in WordPress [closed]
- Place title (in correct place) above image with opaque background [closed]
- multiple html/css files for wordpress theme?
- CSS preprocessor file messed up after compiled
- Why I obtain different visualization when I run the website on my local machine and on remote server?
- my single.php is mixup on some post for no reason
- How to use the _S framework
- getBoundingClientRect() showing different values on load vs scroll
- style variations hurt the editing performance
- wordpress script_loader_tag in function.php
- How to diagnose wp-env environment problem
- Why nav_menu_css_class doesn’t work with apply_filters?
- Default customizer colors aren’t displayed outside of the preview
- Is there a way to add classes to a page when using a Gutenberg reusable block as page layout?
- WordPress doesn’t load css, image and js files after moving local installation folder
- How to generate a rtl.css file for themes?
- Load multiple css simultaneously using functions.php
- overlay post title over post’s featured image
- Customizer Image-Picker Preview Not Working
- Change site title color on individual pages
- Mobile view logo background colour in wordpress
- Enqueue Stylesheets After Theme’s “rtl.css”
- WordPress 3.5 + Foundation 5 not working on IE9
- Theme customizer live preview JS- Trying to bind to an html image url without luck
- Any disadvandages if I style the wordpress align classes without img and .wp-caption prefix
- adding navigation to genesis themes
- wp_deregister_script was called incorrectly
- Using wp_enqueue_script with social media buttons?
- Alternating CSS classes for dynamic content [closed]
- Header is not showing full width
- How do I middle-align my header menu items in WordPress [closed]
- How to resize video lightbox popup in wordpress? [closed]
- How can I get rid of the distance when I’m using list-style-type: none? [closed]
- Theme now uses require.js and enqueue script no longer works
- WP site makes mobile browser crash for high memory usage
- HTML to WORDPRESS [closed]
- jQuery Snippet Not Working on WordPress Site [closed]
- Image and font support missing in editor when deploying theme remotely