Advertisement
Guest User

Untitled

a guest
Feb 2nd, 2013
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.00 KB | None | 0 0
  1. <?php
  2. /*
  3. ==========================================================
  4. THE FUNCTIONS IN THIS FILE ALL TIE INTO THE
  5. 'skematik_header' ACTION HOOK WHICH IS CALLED IN header.php
  6. FILE. DEVELOPERS CAN REMOVE ANYTHING HERE WITH A SIMPLE
  7. 'remove_action' CALL.
  8. ==========================================================
  9. */
  10.  
  11.  
  12.  
  13. /*
  14. ==========================================================
  15. Skematik Doc Type
  16. ==========================================================
  17. */
  18. // Create the doc type and initial meta tags
  19. add_action( 'skematik_header', 'skematik_doc_type', 9 );
  20. function skematik_doc_type() {
  21. ?>
  22. <!DOCTYPE html>
  23. <html <?php language_attributes(); ?>>
  24. <head>
  25. <meta charset="<?php bloginfo( 'charset' ); ?>" />
  26. <meta name="viewport" content="width=device-width" />
  27. <?php
  28. }
  29.  
  30.  
  31.  
  32. /*
  33. ==========================================================
  34. Skematik Title
  35. ==========================================================
  36. */
  37. // Create the title attribute for each page
  38. add_action( 'skematik_header', 'skematik_doc_title', 20 );
  39. function skematik_doc_title() {
  40. ?>
  41. <title>
  42. <?php
  43. /* Print the <title> tag based on what is being viewed.*/
  44. global $page, $paged;
  45.  
  46. wp_title( '|', true, 'right' );
  47.  
  48. // Add the blog name.
  49. // bloginfo( 'name' );
  50.  
  51. // Add the blog description for the home/front page.
  52. $site_description = get_bloginfo( 'description', 'display' );
  53. if ( $site_description && ( is_home() || is_front_page() ) )
  54. echo " | $site_description";
  55.  
  56. // Add a page number if necessary:
  57. if ( $paged >= 2 || $page >= 2 )
  58. echo ' | ' . sprintf( __( 'Page %s', 'skematik' ), max( $paged, $page ) );
  59. ?>
  60. </title>
  61. <?php
  62. }
  63.  
  64.  
  65.  
  66. /*
  67. ==========================================================
  68. Skematik Head
  69. ==========================================================
  70. */
  71. //
  72. add_action( 'skematik_header', 'skematik_head_after', 30 );
  73. function skematik_head_after() {
  74. ?>
  75. <link rel="profile" href="http://gmpg.org/xfn/11" />
  76. <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
  77. <!--[if lt IE 9]>
  78. <script src="<?php echo get_template_directory_uri(); ?>/assets/js/html5.js" type="text/javascript"></script>
  79. <![endif]-->
  80.  
  81. <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
  82. <!--[if lt IE 9]>
  83. <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
  84. <![endif]-->
  85. <?php
  86. do_action('skematik_head');
  87. wp_head();
  88. global $woocommerce;?>
  89. </head>
  90. <?php
  91. }
  92.  
  93.  
  94.  
  95. /*
  96. ==========================================================
  97. Skematik BODY
  98. ==========================================================
  99. */
  100. //
  101. add_action( 'skematik_header', 'skematik_body_open', 40 );
  102. function skematik_body_open() {
  103. ?>
  104. <body <?php body_class(); ?>>
  105. <?php do_action( 'skematik_before' ); ?>
  106. <div class="skematik-site-wrap">
  107. <?php
  108. }
  109.  
  110.  
  111.  
  112. /*
  113. ==========================================================
  114. Skematik Main Nav
  115. ==========================================================
  116. */
  117. //
  118. add_action( 'skematik_header', 'skematik_main_navbar', 50 );
  119. function skematik_main_navbar() {
  120. if(get_theme_mod('logo_image_position', 'in-nav') == 'outside-nav') {
  121. echo '<div class="logo-outside-nav">';
  122. echo skematik_logo();
  123. echo '</div>';
  124. } ?>
  125.  
  126. <div class="navbar <?php echo get_theme_mod( 'navbar_style', 'navbar-fixed-top' );?> <?php echo get_theme_mod( 'navbar_color', 'navbar-default' );?>" id="skematik-top-nav">
  127. <div class="navbar-inner">
  128. <div class="container">
  129. <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
  130. <span class="icon-bar"></span>
  131. <span class="icon-bar"></span>
  132. <span class="icon-bar"></span>
  133. </button>
  134.  
  135. <?php if(get_theme_mod('logo_image_position', 'in-nav') == 'in-nav') {skematik_logo();} ?>
  136. <div class="right-buttons">
  137. <?php if(get_theme_mod( 'navbar_account', 1 ) == 1) {skematik_account_dropdown();} ?>
  138.  
  139. <?php if(get_theme_mod( 'navbar_cart', 1 ) == 1) {skematik_cart_dropdown();} ?>
  140. <?php if(get_theme_mod( 'navbar_search', 1 ) == 1) {skematik_nav_search();} ?>
  141. </div>
  142.  
  143. <div class="nav-collapse collapse">
  144. <?php skematik_main_nav(); // Adjust using Menus in Wordpress Admin ?>
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. <?php
  150. } // END skematik_main_navbar
  151.  
  152. function skematik_nav_styles() {
  153. if(get_theme_mod( 'navbar_style', 'navbar-fixed-top' ) == 'navbar-static-top') {
  154. echo '
  155. body {padding-top:0px;}
  156. body.admin-bar {padding-top:0px;}
  157. #skematik-top-nav {margin-top:-1px;}
  158. ';
  159. }
  160. if(get_theme_mod( 'navbar_style', 'navbar-fixed-top' ) == 'navbar-static-cont-width') {
  161. echo '
  162. body {padding-top:15px;}
  163. body.admin-bar {padding-top:15px;}
  164. #main {margin-top:10px;margin-bottom:10px;}
  165. .hero-unit.masthead {margin-bottom: 25px;}
  166. ';
  167. }
  168. }
  169. add_action('skematik_add_to_custom_style','skematik_nav_styles');
  170.  
  171. /*
  172. ==========================================================
  173. Skematik Content Wrappers
  174. ==========================================================
  175. */
  176. // Create content wrapper HTML
  177. add_action( 'skematik_header', 'skematik_top_content_wrapper', 60 );
  178. function skematik_top_content_wrapper() {
  179. echo '
  180. <div id="contentwrap">
  181. <div id="page" class="hfeed site container">
  182. <div id="main">
  183. <div class="row">';
  184. }
  185.  
  186.  
  187.  
  188. /*
  189. ==========================================================
  190. Skematik Left Sidebar
  191. ==========================================================
  192. */
  193. // Call the left sidebar if this template has one.
  194. add_action( 'skematik_header', 'skematik_left_sidebar', 80 );
  195.  
  196.  
  197.  
  198. /*
  199. ==========================================================
  200. Skematik BuddyPress Top Content Wrapper
  201. ==========================================================
  202. */
  203. //
  204. add_action( 'skematik_before_buddypress', 'skematik_buddypress_top_content_wrapper', 10 );
  205. function skematik_buddypress_top_content_wrapper() {
  206. ?>
  207. <div id="primary" class="site-content <?php skematik_content_span(); ?>">
  208. <div id="content" role="main">
  209. <?php
  210. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement