/functions.php

  1. <?php 
  2.  
  3. include_once get_template_directory() . '/functions/inkthemes-functions.php'; 
  4. $functions_path = get_template_directory() . '/functions/'; 
  5. define('CLASS_PATH', $functions_path); 
  6. /** These files build out the options interface. Likely won't need to edit these. */ 
  7. require_once ($functions_path . 'admin-functions.php'); // Custom functions and plugins 
  8. require_once ($functions_path . 'admin-interface.php'); // Admin Interfaces  
  9. require_once ($functions_path . 'theme-options.php'); // Options panel settings and custom settings 
  10. require_once ($functions_path . 'shortcodes.php'); 
  11. require_once ($functions_path . 'define_template.php'); 
  12. ?> 
  13. <?php 
  14.  
  15. /** ----------------------------------------------------------------------------------- */ 
  16. /** Styles Enqueue */ 
  17. /** ----------------------------------------------------------------------------------- */ 
  18.  
  19. function inkthemes_add_stylesheet() { 
  20. wp_enqueue_style('shortcodes', get_template_directory_uri() . "/css/shortcode.css", '', '', 'all'); 
  21.  
  22. add_action('init', 'inkthemes_add_stylesheet'); 
  23. /** ----------------------------------------------------------------------------------- */ 
  24. /** jQuery Enqueue */ 
  25. /** ----------------------------------------------------------------------------------- */ 
  26.  
  27. function inkthemes_wp_enqueue_scripts() { 
  28. if (!is_admin()) { 
  29. wp_enqueue_script('jquery'); 
  30. wp_enqueue_script('inkthemes-ddsmoothmenu', get_template_directory_uri() . '/js/ddsmoothmenu.js', array('jquery')); 
  31. wp_enqueue_script('flex-slider', get_template_directory_uri() . '/js/jquery.flexslider-min.js', array('jquery')); 
  32. wp_enqueue_script('inkthemes-custom', get_template_directory_uri() . '/js/custom.js', array('jquery')); 
  33. }  
  34.  
  35. add_action('wp_enqueue_scripts', 'inkthemes_wp_enqueue_scripts'); 
  36. /** ----------------------------------------------------------------------------------- */ 
  37. /** Custom Jqueries Enqueue */ 
  38. /** ----------------------------------------------------------------------------------- */ 
  39.  
  40. function inkthemes_custom_jquery() { 
  41. wp_enqueue_script('mobile-menu', get_template_directory_uri() . "/js/mobile-menu.js", array('jquery')); 
  42.  
  43. add_action('wp_footer', 'inkthemes_custom_jquery'); 
  44. //Front Page Rename 
  45. $get_status = inkthemes_get_option('re_nm'); 
  46. $get_file_ac = get_template_directory() . '/front-page.php'; 
  47. $get_file_dl = get_template_directory() . '/front-page-hold.php'; 
  48. //True Part 
  49. if ($get_status === 'off' && file_exists($get_file_ac)) { 
  50. rename("$get_file_ac", "$get_file_dl"); 
  51. //False Part 
  52. if ($get_status === 'on' && file_exists($get_file_dl)) { 
  53. rename("$get_file_dl", "$get_file_ac"); 
  54.  
  55. //inkthemes get option 
  56. function inkthemes_get_option($name) { 
  57. $options = get_option('inkthemes_options'); 
  58. if (isset($options[$name])) 
  59. return $options[$name]; 
  60. //inkthemes update option 
  61. function inkthemes_update_option($name, $value) { 
  62. $options = get_option('inkthemes_options'); 
  63. $options[$name] = $value; 
  64. return update_option('inkthemes_options', $options); 
  65. //inkthemes delete option 
  66. function inkthemes_delete_option($name) { 
  67. $options = get_option('inkthemes_options'); 
  68. unset($options[$name]); 
  69. return update_option('inkthemes_options', $options); 
  70. //Enqueue comment thread js 
  71. function inkthemes_enqueue_scripts() { 
  72. if (is_singular() and get_site_option('thread_comments')) { 
  73. wp_print_scripts('comment-reply'); 
  74. //Enqueue comment thread js 
  75. function blcr_enqueue_scripts() { 
  76. if (is_singular() and get_site_option('thread_comments')) { 
  77. wp_print_scripts('comment-reply'); 
  78.  
  79. add_action('wp_enqueue_scripts', 'blcr_enqueue_scripts'); 
  80. ?> 
.