R
R
Rasul Gitinov2016-02-12 01:46:15
PHP
Rasul Gitinov, 2016-02-12 01:46:15

How to add styles to a WordPress plugin?

How to properly include the css file in the plugin? I just can't handle it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel K, 2016-02-12
@raselgit

Only for the admin panel or for the site as a whole?
Generally speaking, then:

function themeslug_enqueue_style() {
  wp_enqueue_style( 'myStyle', plugins_url( '/css/myStyle.css', __FILE__ ), false ); 
}

add_action( 'wp_enqueue_scripts', 'themeslug_enqueue_style' );

M
mr_firuzinho, 2016-02-20
@mr_firuzinho

you can write in style.css of the template itself

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question