Home > css > how to include other jquery file and css file in wordpress plugins

how to include other jquery file and css file in wordpress plugins

June 20Hits:1
Advertisement

I have jquery file like as follows

"portfolio.css"
"jquery-ui-1.8.18.custom.css"
"portfolio.js"

I want to include these files into my plugin... if anyone have solution for how to include above mentioned file into wordpress plugin then tell me....

please.... thank you in advance

Answers

You should use this snippet inside your function:

wp_register_style('mycss', WP_PLUGIN_URL . '/whatever.css');
wp_enqueue_style('mycss');

Then you add this add_action after your function, to call your the CSS in the :

add_action ( 'wp_head', 'your_function_name');

For javascript, use wp_register_script() and wp_enqueue_script() instead.

WordPress function reference: wp_enqueue_style and wp_enqueue_script

Tags:css

Related Articles

  • how to include javascript file and css file in wordpressApril 9

    I am creating new plugin so i need add a java script file and css file. These are my javascript files jquery.min.js jquery-1.3.2.min.js jquery.tabify.js Css file: newstyle.css --------------Solutions------------- WordPress already ships with jQuery.

  • Trying to compile sass/scss file into css files (one to one)January 22

    We are trying to compile our sass files to css files, however we want to compile each individual sass file into an individual css file (one-to-one). For example our product_view.scss should have a product_view.css. However all configurations we have

  • Adding custom css to a wordpress plugin? February 15

    Possible Duplicate: best way to overide plugin CSS? Now and again I would come across a great wordpress plugin with it's own css style sheet. I could edit the css in the plugin folder and it would work like a charm but if there was ever an update for

  • how to include other jquery file and css file in wordpress pluginsJune 20

    I have jquery file like as follows "portfolio.css" "jquery-ui-1.8.18.custom.css" "portfolio.js" I want to include these files into my plugin... if anyone have solution for how to include above mentioned file into wordpress pl

  • Can we include the js file and css file in visualforce components?October 15

    Here is my scenario, I want to include the css and js file, these are stored in static resources. I need the syntax and how to use these classes and styles defined in css file. --------------Solutions------------- you can simply copy and paste those

  • enqueue css in a wordpress plugin conditionDecember 31

    I have found a bug in a wordpress plugin /plugins/woocommerce-eu-vat-assistant/ In checkout page if the option "Added possibility to make EU VAT field compulsory when the customer enters a company name." of plugin setting is active, when click o

  • How to upload multiple files/images when developing a wordpress plugin?June 8

    I decided to learn how to develop wordpress plugins and I am totally confused and frustrated. I've already read some good tutorials and I guess I am already familiar with the basics. Now, I want to start developing my first plugin and I decided to st

  • Need to know the most essential JS and CSS files for a Drupal 7 page June 2

    I am creating a module that has a page that is intended to be a viewer for a certain kind of content. The content itself is a Drupal Book viewer meant to behave like an epub reader. Basically I want this page to be a stand-alone, theme-independent, f

  • From my Plugin Settings Page use check boxes to load specific css files (e.g. Bootstrap / Foundation)May 21

    This is my first post on here so bare with me if something goes terribly wrong. The wp plugin I am building requires bootstrap for the shortcodes it generates to be styled as expected when rendered in the browser. It will also require the bootstrap j

  • Remove default css fileNovember 6

    I need to remove jquery.ui.theme.css file, for this in my template.php I implement the below mentioned code: function GNG_css_alter(&$css) { unset($css[drupal_get_path('module', 'misc') . '/ui/jquery.ui.theme.css']); } but its not working. ----------

  • Javascript/CSS File Not Loading But is on the page! SharePoint 2013January 13

    I am able to see the the javascript files and css files in the code from the F12 Developer tools but the scripts/CSS files only load when i am logged in the Anonymous User it does not load. Is there anything i am doing wrong here is the code i am usi

  • Batch encode multiple webfont files into a CSS file?July 28

    I want to batch encode several .otf font files into a single CSS file. To my understanding, base64 embedded .otf fonts can be read by most browsers. Since Font-Squirrel's @font-face generator doesn't support direct base64 encoding of .otf files, I'll

  • dir-color failure in html and css files in several terminalsFebruary 28

    I use several types of terminals in my Slackware 13 distribution: xterm, rxvt, Konsole, and xfce's terminal emulator (Terminal 0.4.6). All of them read my .dir_colors file and, for the most part assign colors to file-types as I wish. The exception ar

  • Change tab or open CSS file on SCSS build in Sublime Text 2September 15

    I use SASS Package and SFTP on a regular basis in my development process through Sublime Text 2. The functionality of these are both great, but I'm hoping to reduce the number of steps it takes me to accomplish getting the files to the server. My ste

  • How do I upload a .css file to launchpadApril 8

    I am trying to upload a framework.css file to launchpad with the following command: dput ppa:blade19899/framework.css framework.css_2.0_source.changes but according to this answer source.changes file is a file generated by debuild -S. My question is:

  • How to Add expiry header on thirdparty JS and CSS file in WordPress

    How to Add expiry header on thirdparty JS and CSS file in WordPressApril 13

    I am using different plugins in WordPress like Disqus comment system, Theia Post slider and other.. Here is a result from GTmatrix : I want to know how can I add expiry header on third party JS files and CSS files. I want to increase my Y-Slow grade.

  • .css file not uploading to server after .less compile phpStorm 10January 21

    I have a main.less file that contains @import for a number of .less files that I compile into 1 main.css file. My main.less file: @import "imports/header"; @import "imports/content"; @import "imports/footer"; ...... In phpsto

  • How to find css file path in browser

    How to find css file path in browserJanuary 28

    I am working on theming part in Magento2. Whenever I compile .less file, two css files are created : styles-l.css styles-m.css Whenever we inspect the element and try to see the css applied in the browser, we are not able to find the css file path. I

  • Adding css file to html

    Adding css file to htmlFebruary 15

    I'm working on an real-time chat app with MEAN stack , I begin with html and css , and i'm working on cloud9 platforme, my problem is that i can't add the css file to html !! i tried many time to change the path of my css file but still doesn't work

  • How can I dynamically set paths to files in project files?January 30

    I try to understand how can I assign filepaths in for example index.html file to .css file in development and production environment. Maybe this example will demonstrate my concerns: index.html <!DOCTYPE html> <html> <head> <link href

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 1.205 s.