Advertisement
Guest User

Untitled

a guest
Apr 11th, 2018
102
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /**
  3. * Geodesic functions and definitions
  4. *
  5. * @package Geodesic
  6. */
  7.  
  8. if ( ! function_exists( 'geodesic_setup' ) ) :
  9. /**
  10. * Sets up theme defaults and registers support for various WordPress features.
  11. *
  12. * Note that this function is hooked into the after_setup_theme hook, which
  13. * runs before the init hook. The init hook is too late for some features, such
  14. * as indicating support for post thumbnails.
  15. */
  16. function geodesic_setup() {
  17.  
  18. /*
  19. * Make theme available for translation.
  20. * Translations can be filed in the /languages/ directory.
  21. * If you're building a theme based on Geodesic, use a find and replace
  22. * to change 'geodesic' to the name of your theme in all the template files
  23. */
  24. load_theme_textdomain( 'geodesic', get_template_directory() . '/languages' );
  25.  
  26. // Add default posts and comments RSS feed links to head.
  27. add_theme_support( 'automatic-feed-links' );
  28.  
  29. /*
  30. * Let WordPress manage the document title.
  31. * By adding theme support, we declare that this theme does not use a
  32. * hard-coded <title> tag in the document head, and expect WordPress to
  33. * provide it for us.
  34. */
  35. add_theme_support( 'title-tag' );
  36.  
  37. /*
  38. * Enable support for custom logo.
  39. *
  40. * @link https://codex.wordpress.org/Theme_Logo
  41. */
  42. add_theme_support( 'custom-logo', array(
  43. 'height' => 400,
  44. 'width' => 580,
  45. 'flex-height' => true,
  46. 'flex-width' => true,
  47. 'header-text' => array( 'site-title', 'site-description' ),
  48. ) );
  49.  
  50. /*
  51. * Enable support for Post Thumbnails on posts and pages.
  52. *
  53. * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
  54. */
  55. add_theme_support( 'post-thumbnails' );
  56.  
  57. // Theme Image Sizes
  58. add_image_size( 'geodesic-featured-landscape', 800, 600, true );
  59. add_image_size( 'geodesic-featured-landscape-half', 800, 400, true );
  60. add_image_size( 'geodesic-featured-landscape-quarter', 800, 200, true );
  61.  
  62. // This theme uses wp_nav_menu() in four locations.
  63. register_nav_menus( array (
  64. 'header-menu' => esc_html__( 'Header Menu', 'geodesic' ),
  65. ) );
  66.  
  67. // This theme styles the visual editor to resemble the theme style.
  68. add_editor_style( array ( 'css/editor-style.css', geodesic_fonts_url() ) );
  69.  
  70. /*
  71. * Switch default core markup for search form, comment form, and comments
  72. * to output valid HTML5.
  73. */
  74. add_theme_support( 'html5', array (
  75. 'comment-form', 'comment-list', 'gallery', 'caption'
  76. ) );
  77.  
  78. // Setup the WordPress core custom background feature.
  79. add_theme_support( 'custom-background', apply_filters( 'geodesic_custom_background_args', array (
  80. 'default-color' => 'fff',
  81. 'default-image' => '',
  82. ) ) );
  83.  
  84. }
  85. endif; // geodesic_setup
  86. add_action( 'after_setup_theme', 'geodesic_setup' );
  87.  
  88. /**
  89. * Set the content width in pixels, based on the theme's design and stylesheet.
  90. *
  91. * Priority 0 to make it available to lower priority callbacks.
  92. *
  93. * @global int $content_width
  94. */
  95. function geodesic_content_width() {
  96. $GLOBALS['content_width'] = apply_filters( 'geodesic_content_width', 770 );
  97. }
  98. add_action( 'after_setup_theme', 'geodesic_content_width', 0 );
  99.  
  100. /**
  101. * Register widget area.
  102. *
  103. * @link http://codex.wordpress.org/Function_Reference/register_sidebar
  104. */
  105. function geodesic_widgets_init() {
  106.  
  107. // Widget Areas
  108. register_sidebar( array(
  109. 'name' => esc_html__( 'Main Sidebar', 'geodesic' ),
  110. 'id' => 'sidebar-1',
  111. 'before_widget' => '<aside id="%1$s" class="widget %2$s">',
  112. 'after_widget' => '</aside>',
  113. 'before_title' => '<h2 class="widget-title">',
  114. 'after_title' => '</h2>',
  115. ) );
  116. register_sidebar( array(
  117. 'name' => esc_html__( 'Main Sidebar', 'geodesic' ),
  118. 'id' => 'sidebar-2',
  119. 'before_widget' => '<aside id="%1$s" class="widget %2$s">',
  120. 'after_widget' => '</aside>',
  121. 'before_title' => '<h2 class="widget-title">',
  122. 'after_title' => '</h2>',
  123. ) );
  124. }
  125. add_action( 'widgets_init', 'geodesic_widgets_init' );
  126.  
  127. /**
  128. * Enqueue scripts and styles.
  129. */
  130. function geodesic_scripts() {
  131.  
  132. /**
  133. * Enqueue JS files
  134. */
  135.  
  136. // Enquire
  137. wp_enqueue_script( 'enquire', get_template_directory_uri() . '/js/enquire.js', array( 'jquery' ), '2.1.2', true );
  138.  
  139. // Fitvids
  140. wp_enqueue_script( 'fitvids', get_template_directory_uri() . '/js/fitvids.js', array( 'jquery' ), '1.1', true );
  141.  
  142. // Superfish Menu
  143. wp_enqueue_script( 'hover-intent', get_template_directory_uri() . '/js/hover-intent.js', array( 'jquery' ), 'r7', true );
  144. wp_enqueue_script( 'superfish', get_template_directory_uri() . '/js/superfish.js', array( 'jquery' ), '1.7.5', true );
  145.  
  146. // Comment Reply
  147. if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
  148. wp_enqueue_script( 'comment-reply' );
  149. }
  150.  
  151. // Keyboard image navigation support
  152. if ( is_singular() && wp_attachment_is_image() ) {
  153. wp_enqueue_script( 'geodesic-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20140127', true );
  154. }
  155.  
  156. // Custom Script
  157. wp_enqueue_script( 'geodesic-custom', get_template_directory_uri() . '/js/custom.js', array( 'jquery' ), '1.0', true );
  158.  
  159. /**
  160. * Enqueue CSS files
  161. */
  162.  
  163. // Bootstrap Custom
  164. wp_enqueue_style( 'geodesic-bootstrap-custom', get_template_directory_uri() . '/css/bootstrap-custom.css' );
  165.  
  166. // Fontawesome
  167. wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/css/font-awesome.css' );
  168.  
  169. // Fonts
  170. wp_enqueue_style( 'geodesic-fonts', geodesic_fonts_url(), array(), null );
  171.  
  172. // Theme Stylesheet
  173. wp_enqueue_style( 'geodesic-style', get_stylesheet_uri() );
  174.  
  175. }
  176. add_action( 'wp_enqueue_scripts', 'geodesic_scripts' );
  177.  
  178. /**
  179. * Custom functions that act independently of the theme templates.
  180. */
  181. require get_template_directory() . '/inc/extras.php';
  182.  
  183. /**
  184. * Custom template tags for this theme.
  185. */
  186. require get_template_directory() . '/inc/template-tags.php';
  187.  
  188. /**
  189. * Implement the Custom Header feature.
  190. */
  191. require get_template_directory() . '/inc/custom-header.php';
  192.  
  193. /**
  194. * Customizer additions.
  195. */
  196. require get_template_directory() . '/inc/customizer.php';
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement