1. <?php
  2. // Set Content Width
  3. if ( ! isset( $content_width ) )
  4. $content_width = 530;
  5. /*==================================== THEME SETUP ====================================*/
  6. // Load default style.css and Javascripts
  7. add_action('wp_enqueue_scripts', 'themezee_enqueue_scripts');
  8. if ( ! function_exists( 'themezee_enqueue_scripts' ) ):
  9. function themezee_enqueue_scripts() {
  10. // Register and Enqueue Stylesheet
  11. wp_register_style('zeeStyle_stylesheet', get_stylesheet_uri());
  12. wp_enqueue_style('zeeStyle_stylesheet');
  13. // Enqueue jQuery Framework
  14. wp_enqueue_script('jquery');
  15. // Register and enqueue the Malsup Cycle Plugin
  16. wp_register_script('zee_jquery-cycle', get_template_directory_uri() .'/includes/js/jquery.cycle.all.min.js', array('jquery'));
  17. wp_enqueue_script('zee_jquery-cycle');
  18. }
  19. endif;
  20. // Load comment-reply.js if comment form is loaded and threaded comments activated
  21. add_action( 'comment_form_before', 'themezee_enqueue_comment_reply' );
  22. function themezee_enqueue_comment_reply() {
  23. if( get_option( 'thread_comments' ) ) {
  24. wp_enqueue_script( 'comment-reply' );
  25. }
  26. }
  27. // Setup Function: Registers support for various WordPress features
  28. add_action( 'after_setup_theme', 'themezee_setup' );
  29. if ( ! function_exists( 'themezee_setup' ) ):
  30. function themezee_setup() {
  31. // init Localization
  32. load_theme_textdomain('themezee_lang', get_template_directory() . '/includes/lang' );
  33. // Add Theme Support
  34. add_theme_support('post-thumbnails');
  35. add_theme_support('automatic-feed-links');
  36. add_editor_style();
  37. // Add Custom Background
  38. add_theme_support('custom-background', array(
  39. 'default-color' => '333',
  40. 'default-image' => get_template_directory_uri() . '/images/background.png'));
  41. // Add Custom Header
  42. add_theme_support('custom-header', array(
  43. 'default-image' => get_template_directory_uri() . '/images/default_header.jpg',
  44. 'header-text' => false,
  45. 'width' => 940,
  46. 'height' => 140,
  47. 'flex-height' => true,
  48. 'wp-head-callback' => 'themezee_header_style'));
  49. // Register Navigation Menus
  50. register_nav_menu( 'main_navi', __('Navigation', 'themezee_lang') );
  51. }
  52. endif;
  53. // Defines extra CSS for Custom Header
  54. function themezee_header_style() {
  55. ?><style type="text/css">
  56. #custom_header img {
  57. margin: 5px 5px 0 5px;
  58. }
  59. </style><?php
  60. }
  61. // Register Sidebars
  62. add_action( 'widgets_init', 'themezee_register_sidebars' );
  63. if ( ! function_exists( 'themezee_register_sidebars' ) ):
  64. function themezee_register_sidebars() {
  65. // Register Sidebars
  66. register_sidebar(array('name' => __('Sidebar Top', 'themezee_lang'), 'id' => 'sidebar-top'));
  67. register_sidebar(array('name' => __('Sidebar Left', 'themezee_lang'), 'id' => 'sidebar-left'));
  68. register_sidebar(array('name' => __('Sidebar Right', 'themezee_lang'), 'id' => 'sidebar-right'));
  69. register_sidebar(array('name' => __('Sidebar Bottom', 'themezee_lang'), 'id' => 'sidebar-bottom'));
  70. //Register Footer Bars
  71. register_sidebar(array('name' => __('Footer Sidebar Left', 'themezee_lang'), 'id' => 'sidebar-footer-left'));
  72. register_sidebar(array('name' => __('Footer Sidebar Center Left', 'themezee_lang'), 'id' => 'sidebar-footer-center-left'));
  73. register_sidebar(array('name' => __('Footer Sidebar Center Right', 'themezee_lang'), 'id' => 'sidebar-footer-center-right'));
  74. register_sidebar(array('name' => __('Footer Sidebar Right', 'themezee_lang'), 'id' => 'sidebar-footer-right'));
  75. }
  76. endif;
  77. /*==================================== INCLUDE FILES ====================================*/
  78. // Includes all files needed for theme options, custom JS/CSS and Widgets
  79. add_action( 'after_setup_theme', 'themezee_include_files' );
  80. if ( ! function_exists( 'themezee_include_files' ) ):
  81. function themezee_include_files() {
  82. // include Admin Files
  83. locate_template('/includes/admin/theme-functions.php', true);
  84. locate_template('/includes/admin/theme-admin.php', true);
  85. // include custom Javascript and custom CSS Handler files
  86. locate_template('/includes/js/jscript.php', true);
  87. locate_template('/includes/css/csshandler.php', true);
  88. // include Widget Files
  89. locate_template('/includes/widgets/theme-widget-ads.php', true);
  90. locate_template('/includes/widgets/theme-widget-socialmedia.php', true);
  91. }
  92. endif;
  93. /*==================================== THEME FUNCTIONS ====================================*/
  94. // Creates a better title element text for output in the head section
  95. add_filter( 'wp_title', 'themezee_wp_title', 10, 2 );
  96. function themezee_wp_title( $title, $sep = '' ) {
  97. global $paged, $page;
  98. if ( is_feed() )
  99. return $title;
  100. // Add the site name.
  101. $title .= get_bloginfo( 'name' );
  102. // Add the site description for the home/front page.
  103. $site_description = get_bloginfo( 'description', 'display' );
  104. if ( $site_description && ( is_home() || is_front_page() ) )
  105. $title = "$title $sep $site_description";
  106. // Add a page number if necessary.
  107. if ( $paged >= 2 || $page >= 2 )
  108. $title = "$title $sep " . sprintf( __( 'Page %s', 'themezee' ), max( $paged, $page ) );
  109. return $title;
  110. }
  111. // Add Default Menu Fallback Function
  112. function themezee_default_menu() {
  113. echo '<ul id="nav" class="menu">'. wp_list_pages('title_li=&echo=0') .'</ul>';
  114. }
  115. // Display Credit Link Function
  116. function themezee_credit_link() { ?>
  117. <a href="http://www.rls-movies.com/"><?php _e('Powerd by Leeder', 'themezee_lang'); ?></a>
  118. <?php
  119. }
  120. // Change Excerpt Length
  121. add_filter('excerpt_length', 'themezee_excerpt_length');
  122. function themezee_excerpt_length($length) {
  123. return 30;
  124. }
  125. // Change Excerpt More
  126. add_filter('excerpt_more', 'themezee_excerpt_more');
  127. function themezee_excerpt_more($more) {
  128. return '';
  129. }
  130. // Add Postmeta Data
  131. add_action( 'themezee_display_postmeta_index', 'themezee_postmeta_content' );
  132. add_action( 'themezee_display_postmeta_single', 'themezee_postmeta_content' );
  133. function themezee_postmeta_content() { ?>
  134. <span class="meta-date"><a href="<?php the_permalink(); ?>"><?php the_time(get_option('date_format')); ?></a></span>
  135. <span class="meta-author"><?php the_author_posts_link(); ?></span>
  136. <span class="meta-category"><?php the_category(', '); ?></span>
  137. <span class="meta-comments"><?php comments_popup_link( __('No comments', 'themezee_lang'),__('One comment','themezee_lang'),__('% comments','themezee_lang') ); ?></span>
  138. <div class="clear"></div>
  139. <?php
  140. }
  141. function remove_comment_fields($fields) {
  142. unset($fields['url']);
  143. return $fields;
  144. }
  145. add_filter('comment_form_default_fields','remove_comment_fields');
  146. // Add Postinfo Data
  147. add_action( 'themezee_display_postinfo_index', 'themezee_postinfo_content' );
  148. add_action( 'themezee_display_postinfo_single', 'themezee_postinfo_content' );
  149. function themezee_postinfo_content() { ?>
  150. <span class="meta-tags"><?php the_tags('<ul><li><strong>'.__('Tags: ', 'themezee_lang').'</strong></li><li>','</li><li>','</li></ul>'); ?></span>
  151. <div class="clear"></div>
  152. <?php
  153. }
  154. add_filter('widget_text', 'do_shortcode');
  155. ?>