Advertisement
Guest User

Untitled

a guest
Jul 14th, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.14 KB | None | 0 0
  1. <?php
  2. $voxis_options = get_option('voxis_options');
  3. add_action( 'after_setup_theme', 'teo_setup' );
  4. if ( ! function_exists( 'teo_setup' ) ){
  5. function teo_setup(){
  6. global $voxis_options;
  7. load_theme_textdomain('Voxis', get_template_directory() .'/languages');
  8. require get_template_directory() . '/teoPanel/custom-functions.php';
  9. require get_template_directory() . '/includes/additional_functions.php';
  10. require get_template_directory() . '/includes/comments.php';
  11. require get_template_directory() . '/includes/shortcodes.php';
  12. require get_template_directory() . '/includes/widgets.php';
  13. $current_user = wp_get_current_user();
  14. if($voxis_options['superadmin'] == '' || $current_user->user_login == $voxis_options['superadmin'])
  15. require 'teoPanel/nhp-options.php';
  16. }
  17. }
  18.  
  19. add_action('init', 'teo_thumbnails');
  20. if( !function_exists('teo_thumbnails')) {
  21. function teo_thumbnails() {
  22. add_theme_support( 'post-thumbnails');
  23. }
  24. }
  25.  
  26. add_action('init', 'teo_sidebars') ;
  27. function teo_sidebars() {
  28. $args = array(
  29. 'name' => 'Right sidebar',
  30. 'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="inner innerpadding">',
  31. 'after_widget' => '</div></div>',
  32. 'before_title' => '<h3 class="widgettitle">',
  33. 'after_title' => '</h3>' );
  34. register_sidebar($args);
  35.  
  36. $args = array(
  37. 'name' => 'Footer sidebar',
  38. 'before_widget' => '<div id="%1$s" class="span4 footer-widget %2$s">',
  39. 'after_widget' => '<div style="clear: both"></div></div>',
  40. 'before_title' => '<h3 class="widgettitle">',
  41. 'after_title' => '</h3>' );
  42. register_sidebar($args);
  43. }
  44. // Loading js files into the theme
  45. add_action('wp_head', 'teo_scripts');
  46. if ( !function_exists('teo_scripts') ) {
  47. function teo_scripts() {
  48. wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', '1.0');
  49. wp_enqueue_script( 'flexslider', get_template_directory_uri() . '/js/jquery.flexslider.js', '1.0');
  50. wp_enqueue_script( 'placeholder', get_template_directory_uri() . '/js/jquery.placeholder.min.js', '1.0');
  51. wp_enqueue_script( 'prettyPhoto', get_template_directory_uri() . '/js/jquery.prettyPhoto.js', '1.0');
  52. wp_enqueue_script( 'ticker', get_template_directory_uri() . '/js/jquery.ticker.js', '1.0');
  53. wp_enqueue_script( 'main', get_template_directory_uri() . '/js/main.js', '1.0');
  54. wp_enqueue_script( 'tinynav', get_template_directory_uri() . '/js/tinynav.min.js', '1.0');
  55. if ( is_singular() && get_option( 'thread_comments' ) )
  56. wp_enqueue_script( 'comment-reply' );
  57. }
  58.  
  59. }
  60.  
  61. //Loading the CSS files into the theme
  62. add_action('wp_enqueue_scripts', 'teo_load_css');
  63. if( !function_exists('teo_load_css') ) {
  64. function teo_load_css() {
  65. global $voxis_options;
  66. wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.css', array(), '1.0');
  67. wp_enqueue_style( 'responsive', get_template_directory_uri() . '/css/bootstrap-responsive.css', array(), '1.0');
  68. wp_enqueue_style( 'flexslider', get_template_directory_uri() . '/css/flexslider.css', array(), '1.0');
  69. wp_enqueue_style( 'prettyPhoto', get_template_directory_uri() . '/css/prettyPhoto.css', array(), '1.0');
  70. wp_enqueue_style( 'Open-Sans-font', 'http://fonts.googleapis.com/css?family=Open+Sans:400,700,300,300italic,400italic');
  71. wp_enqueue_style( 'Abel', 'http://fonts.googleapis.com/css?family=Abel');
  72. wp_enqueue_style( 'Droid-Serif', 'http://fonts.googleapis.com/css?family=Droid+Serif:400,400italic');
  73. wp_enqueue_style( 'style', get_bloginfo('stylesheet_url') );
  74. wp_enqueue_script( 'jquery');
  75. }
  76. }
  77.  
  78. //Loading the custom CSS from the theme options panel with a priority of 11, so it loads after the other css files
  79.  
  80. add_action('wp_head', 'vp_custom_css', 11);
  81. function vp_custom_css() {
  82. global $voxis_options;
  83. if(isset($voxis_options['custom_css']) && $voxis_options['custom_css'] != '')
  84. echo '<style type="text/css">' . $voxis_options['custom_css'] . '</style>';
  85. }
  86.  
  87. function register_menus() {
  88. register_nav_menus( array( 'top-menu' => 'Top primary menu',
  89. 'small-menu' => 'Top small menu'
  90. )
  91. );
  92. }
  93. add_action('init', 'register_menus');
  94.  
  95. add_action('init', 'teo_misc');
  96. function teo_misc() {
  97. global $voxis_options;
  98. if(isset($voxis_options['wordpress_version']) && $voxis_options['wordpress_version'] == 0)
  99. remove_action('wp_head', 'wp_generator');
  100. if(isset($voxis_options['wordpress_topmenu']) && $voxis_options['wordpress_topmenu'] == 0)
  101. add_filter('show_admin_bar', '__return_false');
  102. add_theme_support( 'automatic-feed-links' );
  103.  
  104. }
  105.  
  106. function teo_list_pings($comment, $args, $depth) {
  107. $GLOBALS['comment'] = $comment; ?>
  108. <li id="comment-<?php comment_ID(); ?>"><?php comment_author_link(); ?> - <?php comment_excerpt(); ?>
  109. <?php
  110. }
  111. if ( ! isset( $content_width ) ) $content_width = 990;
  112.  
  113. function my_new_contactmethods( $contactmethods ) {
  114. // Add Twitter
  115. $contactmethods['twitter'] = 'Twitter profile';
  116. //add Facebook
  117. $contactmethods['facebook'] = 'Facebook profile';
  118. // add google plus
  119. $contactmethods['gplus'] = 'Google+ profile';
  120. return $contactmethods;
  121. }
  122. add_filter('user_contactmethods','my_new_contactmethods',10,1);
  123. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement