Saturday, 17 August 2019 08:22

how to add styles in wordpress plugin

Written by 
Rate this item
(0 votes)

Adding scripts and styles in wordpress is different from 

what we do in a normal php sites of course.

 If you don't add scripts and styles following wordpress 

rules then things can be messed up and break.

Following are codes which injects your style files in a proper 

location 

wp_register_style('mrcf_html_form_code_styles', plugins_url('mrcf_stylesheet.css', __FILE__));

wp_enqueue_style('mrcf_html_form_code_styles');

 

After providing all the parameters in wp_register_style, we can 

just call the script in wp_enqueue_style() which 

makes everything happen.

Learn details about these parameters by google search.

Read 1374 times Last modified on Saturday, 17 August 2019 08:27
Super User

Email This email address is being protected from spambots. You need JavaScript enabled to view it.

Latest discussions

  • No posts to display.