Guest User

functions.php

a guest
Mar 3rd, 2014
85
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. /*-----------------------------------------------------------------------------------*/
  4. // Register and Minify Core Stylesheets
  5. /*-----------------------------------------------------------------------------------*/
  6.  
  7. function st_registerstyles() {
  8.     $minpath = '/min';
  9.  
  10.     $child_theme = str_replace(site_url().'/wp-content/themes/', '', get_bloginfo('stylesheet_directory'));
  11.     $parent_theme = str_replace(site_url().'/wp-content/themes/', '', get_bloginfo('template_directory'));
  12.     $preset_style   = of_get_option('layout_style');
  13.    
  14.     $minify = array(
  15.         $parent_theme.'/css/formalize.css',
  16.         $parent_theme.'/css/flexslider.css',
  17.         $parent_theme.'/css/skeleton-1200.css',
  18.         $parent_theme.'/css/animate-custom.css',
  19.         $parent_theme.'/css/prettyphoto.css',
  20.         $parent_theme.'/superfish.css',
  21.         $parent_theme.'/layout.css',
  22.         $child_theme.'/style.css',
  23.         $child_theme.'/'.$preset_style.'.css'
  24.     );
  25.     $stylesheets = join( ',', $minify );
  26.  
  27.     wp_enqueue_style('theme-styles', $wpsite.$minpath.'/b=wp-content/themes&amp;f='.$stylesheets, NULL, NULL, NULL, 'screen, projection');
  28. }
  29.  
  30. add_action( 'wp_enqueue_scripts', 'st_registerstyles');
  31.  
  32.  
  33. /*-----------------------------------------------------------------------------------*/
  34. // Register and Minify JS
  35. /*-----------------------------------------------------------------------------------*/
  36.  
  37. function st_header_scripts() {
  38.     $minpath = '/min';
  39.  
  40.     $parent_theme = str_replace(site_url().'/wp-content/themes/', '', get_bloginfo('template_url'));
  41.    
  42.     $minify = array(
  43.         $parent_theme.'/javascripts/custom.js',
  44.         $parent_theme.'/javascripts/jquery.cycle.min.js',
  45.         $parent_theme.'/javascripts/superfish.js',
  46.         $parent_theme.'/javascripts/jquery.formalize.min.js',
  47.         $parent_theme.'/javascripts/jquery.flexslider.js',
  48.         $parent_theme.'/javascripts/jquery.backstretch.min.js',
  49.         $parent_theme.'/javascripts/jquery.prettyphoto.js'
  50.     );
  51.     $javascripts = join( ',', $minify );
  52.  
  53.     wp_enqueue_script('javascript', $wpsite.$minpath.'/b=wp-content/themes&amp;f='.$javascripts, array('jquery'),$version,true);
  54. }
  55.  
  56. add_action( 'wp_enqueue_scripts', 'st_header_scripts');
  57.  
  58.  
  59. /*-----------------------------------------------------------------------------------*/
  60. // Sticky Menu Delay and Custom Scripts
  61. /*-----------------------------------------------------------------------------------*/
  62.  
  63. function custom_enqueue_script() {
  64.     wp_enqueue_script( 'custom-shizzle', get_stylesheet_directory_uri() . '/js/custom-shizzle.js', array( 'jquery' ), '', true );
  65. }
  66.  
  67. add_action( 'wp_enqueue_scripts', 'custom_enqueue_script' );
  68.  
  69.  
  70. /*-----------------------------------------------------------------------------------*/
  71. // Allow SVG uploads to WP uploader
  72. /*-----------------------------------------------------------------------------------*/
  73.  
  74. function cc_mime_types( $mimes ){
  75.     $mimes['svg'] = 'image/svg+xml';
  76.     return $mimes;
  77. }
  78. add_filter( 'upload_mimes', 'cc_mime_types' );
  79.  
  80.  
  81. /*-----------------------------------------------------------------------------------*/
  82. // Footer Navigation
  83. /*-----------------------------------------------------------------------------------*/
  84.  
  85.     function st_footer_nav() {}
  86.    
  87.     remove_action('st_footer', 'st_footer_nav',4);
  88.  
  89.  
  90. /*-----------------------------------------------------------------------------------*/
  91. // Footer Fine Print
  92. /*-----------------------------------------------------------------------------------*/
  93.  
  94.     function st_footer_credits() {
  95.         // prints site credits
  96.         echo '<div id="credits">';
  97.         echo of_get_option('footer_text');
  98.         echo '</div>';
  99.     }
  100.  
  101.     add_action('st_footer', 'st_footer_credits',5);
  102.  
  103. ?>
RAW Paste Data