add a stylesheet to functions.php

you have to create a new folder on your theme folder, name it functions then create a new css file with a name of functions.css. After flling your css file add this code to functions.php after mytheme_add_admin function 


function mytheme_add_style() {
2$file_dir=get_bloginfo('template_directory');
3wp_enqueue_style("functions",$file_dir."/functions/functions.css", false, "1.0", "all");
4}

That adds the functions.css file to the head. The location of the file is determined by the template directory.
Also, if you want you can use scripts to make your options page better by including a js file.To do this you have to change
1wp_enqueue_style("functions",$file_dir."/functions/functions.css", false, "1.0", "all");
To :
1wp_enqueue_script("script", $file_dir."/functions/script.js", false, "1.0");
After adding your stylesheet or your script, you have to add this code under add_action(‘admin_menu’, ‘mytheme_add_admin’); so they will be active :
1add_action('admin_init', 'mytheme_add_init');

Comments

Popular posts from this blog

Text Smooth Scrolling Marquee use jQuery