Advertisement
firoze

Theme Stylesheet-For-Calling-in-Head

Apr 4th, 2015
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. // Theme Stylesheet-For-Calling-in-Head
  2.  
  3.  
  4. <!-- call this in before head -->
  5. <?php global $data; ?>
  6. <?php if($data['ams_site_title']): ?>
  7. <link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/<?php echo do_shortcode(stripslashes($data['ams_site_title']));?>.css" media="all" />
  8. <?php endif; ?>
  9.  
  10.  
  11.  
  12. <!-- call this into admin->functions->functions.option.php -->
  13. // Theme Stylesheet Option
  14. $of_options[] = array( "name" => "Theme Stylesheet",
  15. "type" => "heading"
  16. );
  17.  
  18. $of_options[] = array( "name" => "Theme Stylesheet",
  19. "desc" => "Select your themes alternative color scheme.",
  20. "id" => "ams_site_title",
  21. "std" => "default.css",
  22. "type" => "select",
  23. "options" => array(
  24. 'light' => 'light css',
  25. 'dark' => 'dark css',
  26. 'red' => 'red css',
  27. 'theme_stylesheet.css' => 'theme_stylesheet',
  28. )
  29. );
  30.  
  31.  
  32. <!-- call this into your functions.php -->
  33.  
  34. function sd_css_style() {
  35. /* ------------------------------------------------------------------------ */
  36. /* Register Stylesheets */
  37. /* ------------------------------------------------------------------------ */
  38.  
  39. wp_register_style('theme_stylesheet', get_template_directory_uri() . '/css/theme_stylesheet.css', 'style');
  40.  
  41. /* ------------------------------------------------------------------------ */
  42. /* Enqueue Styles */
  43. /* ------------------------------------------------------------------------ */
  44. wp_enqueue_style( 'theme_stylesheet');
  45. }
  46. add_action( 'wp_enqueue_scripts', 'sd_css_style', 1 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement