/functions.php

  1. <?php 
  2.  
  3. if ( ! defined( 'ADVANTAGE_VERSION' ) ) 
  4. define( 'ADVANTAGE_VERSION', '1.0.0' ); 
  5.  
  6. add_action( 'after_setup_theme', 'advantage_setup' ); 
  7. if ( ! function_exists( 'advantage_setup' ) ): 
  8. function advantage_setup() { 
  9. global $content_width; 
  10. if ( ! isset( $content_width ) )  
  11. $content_width = 700; 
  12.  
  13. add_theme_support( 'post-thumbnails' ); 
  14. add_theme_support( 'automatic-feed-links' ); 
  15. add_theme_support( 'post-formats', array( 'aside', 'link', 'quote' ) ); 
  16.  
  17. load_theme_textdomain( 'advantage', get_template_directory() . '/languages' ); 
  18. add_editor_style(); 
  19. add_theme_support( 'custom-background', array( 
  20. 'default-color' => '', //Default background color 
  21. ) ); 
  22. $custom_header_support = array( 
  23. 'default-image' => get_template_directory_uri() . '/images/logo.png',  
  24. 'flex-width' => true,  
  25. 'flex-height' => true,  
  26. 'header-text' => true,  
  27. 'default-text-color' => '000000',  
  28. 'width' => apply_filters( 'advantage_header_image_width', 200 ),  
  29. 'height' => apply_filters( 'advantage_header_image_height', 60 ),  
  30. // Callback for styling the header. 
  31. 'wp-head-callback' => 'advantage_header_style',  
  32. // Callback for styling the header preview in the admin. 
  33. 'admin-head-callback' => 'advantage_admin_header_style',  
  34. // Callback used to display the header preview in the admin. 
  35. 'admin-preview-callback' => 'advantage_admin_header_image',  
  36. ); 
  37. add_theme_support( 'custom-header', $custom_header_support );  
  38. register_default_headers( array( 
  39. 'header' => array( 
  40. 'url' => '%s/images/logo.png',  
  41. 'thumbnail_url' => '%s/images/logo.png',  
  42. 'description' => __( 'Logo', 'advantage' ) 
  43. ),  
  44. ) ); 
  45.  
  46. remove_filter('term_description', 'wpautop'); 
  47.  
  48. register_nav_menus( array( 
  49. 'section-menu' => __( 'Section Menu', 'advantage' ),  
  50. 'footer' => __( 'Footer Menu', 'advantage' ),  
  51. )); 
  52. endif; 
  53.  
  54. function advantage_widgets_init() { 
  55. register_widget( 'advantage_Recent_Post' ); 
  56. register_widget( 'advantage_Navigation' ); 
  57. register_widget( 'advantage_Marketing' ); 
  58.  
  59. // Full Sidebar  
  60. register_sidebar( array( 
  61. 'name' => __( 'Blog Widget Area (Full)', 'advantage' ),  
  62. 'id' => 'full-widget-area',  
  63. 'description' => __( 'Available for Left or Right sidebar layout.', 'advantage' ),  
  64. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',  
  65. 'after_widget' => '</li>',  
  66. 'before_title' => '<h4 class="widget-title">',  
  67. 'after_title' => '</h4>',  
  68. ) );  
  69. // First Sidebar - left or right 
  70. register_sidebar( array( 
  71. 'name' => __( 'Blog Widget Area 1', 'advantage' ),  
  72. 'id' => 'first-widget-area',  
  73. 'description' => __( 'Blog Widget Area 1', 'advantage' ),  
  74. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',  
  75. 'after_widget' => '</li>',  
  76. 'before_title' => '<h4 class="widget-title">',  
  77. 'after_title' => '</h4>',  
  78. ) ); 
  79.  
  80. // Second Sidebar - left or right 
  81. register_sidebar( array( 
  82. 'name' => __( 'Blog Widget Area 2', 'advantage' ),  
  83. 'id' => 'second-widget-area',  
  84. 'description' => __( 'Blog Widget Area 2', 'advantage' ),  
  85. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',  
  86. 'after_widget' => '</li>',  
  87. 'before_title' => '<h4 class="widget-title">',  
  88. 'after_title' => '</h4>',  
  89. ) ); 
  90.  
  91. // Header Widget Area 
  92. register_sidebar( array( 
  93. 'name' => __( 'Header Widget Area (Left)', 'advantage' ),  
  94. 'id' => 'left-widget-area',  
  95. 'description' => __( 'Header Widget Area (Left)', 'advantage' ),  
  96. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',  
  97. 'after_widget' => '</li>',  
  98. 'before_title' => '<h4 class="widget-title">',  
  99. 'after_title' => '</h4>',  
  100. ) ); 
  101.  
  102. register_sidebar( array( 
  103. 'name' => __( 'Header Widget Area (Right)', 'advantage' ),  
  104. 'id' => 'right-widget-area',  
  105. 'description' => __( 'Header Widget Area (Right)', 'advantage' ),  
  106. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',  
  107. 'after_widget' => '</li>',  
  108. 'before_title' => '<h4 class="widget-title">',  
  109. 'after_title' => '</h4>',  
  110. ) ); 
  111. register_sidebar( array( 
  112. 'name' => __( 'Header Widget Area (Center)', 'advantage' ),  
  113. 'id' => 'center-widget-area',  
  114. 'description' => __( 'Header Widget Area (Center)', 'advantage' ),  
  115. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',  
  116. 'after_widget' => '</li>',  
  117. 'before_title' => '<h4 class="widget-title">',  
  118. 'after_title' => '</h4>',  
  119. ) ); 
  120.  
  121. // Home Widget Areas 
  122. register_sidebar( array( 
  123. 'name' => __( 'Home Widget Area 1', 'advantage' ),  
  124. 'id' => 'first-home-widget-area',  
  125. 'description' => __( 'Home Widget Area 1', 'advantage' ),  
  126. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',  
  127. 'after_widget' => '</li>',  
  128. 'before_title' => '<h4 class="widget-title">',  
  129. 'after_title' => '</h4>',  
  130. ) ); 
  131. register_sidebar( array( 
  132. 'name' => __( 'Home Widget Area 2', 'advantage' ),  
  133. 'id' => 'second-home-widget-area',  
  134. 'description' => __( 'Home Widget Area 2', 'advantage' ),  
  135. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',  
  136. 'after_widget' => '</li>',  
  137. 'before_title' => '<h4 class="widget-title">',  
  138. 'after_title' => '</h4>',  
  139. ) ); 
  140. register_sidebar( array( 
  141. 'name' => __( 'Home Widget Area 3', 'advantage' ),  
  142. 'id' => 'third-home-widget-area',  
  143. 'description' => __( 'Home Widget Area 3', 'advantage' ),  
  144. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',  
  145. 'after_widget' => '</li>',  
  146. 'before_title' => '<h4 class="widget-title">',  
  147. 'after_title' => '</h4>',  
  148. ) ); 
  149. register_sidebar( array( 
  150. 'name' => __( 'Home Widget Area 4', 'advantage' ),  
  151. 'id' => 'fourth-home-widget-area',  
  152. 'description' => __( 'Home Widget Area 4', 'advantage' ),  
  153. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',  
  154. 'after_widget' => '</li>',  
  155. 'before_title' => '<h4 class="widget-title">',  
  156. 'after_title' => '</h4>',  
  157. ) ); 
  158. register_sidebar( array( 
  159. 'name' => __( 'Home Widget Area 5', 'advantage' ),  
  160. 'id' => 'fifth-home-widget-area',  
  161. 'description' => __( 'Home Widget Area 5', 'advantage' ),  
  162. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',  
  163. 'after_widget' => '</li>',  
  164. 'before_title' => '<h4 class="widget-title">',  
  165. 'after_title' => '</h4>',  
  166. ) ); 
  167.  
  168. // Footer Widgets 
  169. register_sidebar( array( 
  170. 'name' => __( 'Footer Widget Area 1', 'advantage' ),  
  171. 'id' => 'first-footer-widget-area',  
  172. 'description' => __( 'Footer Widget Area 1', 'advantage' ),  
  173. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',  
  174. 'after_widget' => '</li>',  
  175. 'before_title' => '<h5 class="widget-title">',  
  176. 'after_title' => '</h5>',  
  177. ) ); 
  178.  
  179. register_sidebar( array( 
  180. 'name' => __( 'Footer Widget Area 2', 'advantage' ),  
  181. 'id' => 'second-footer-widget-area',  
  182. 'description' => __( 'Footer Widget Area 2', 'advantage' ),  
  183. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',  
  184. 'after_widget' => '</li>',  
  185. 'before_title' => '<h5 class="widget-title">',  
  186. 'after_title' => '</h5>',  
  187. ) ); 
  188.  
  189. register_sidebar( array( 
  190. 'name' => __( 'Footer Widget Area 3', 'advantage' ),  
  191. 'id' => 'third-footer-widget-area',  
  192. 'description' => __( 'Footer Widget Area 3', 'advantage' ),  
  193. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',  
  194. 'after_widget' => '</li>',  
  195. 'before_title' => '<h5 class="widget-title">',  
  196. 'after_title' => '</h5>',  
  197. ) ); 
  198.  
  199. register_sidebar( array( 
  200. 'name' => __( 'Footer Widget Area 4', 'advantage' ),  
  201. 'id' => 'fourth-footer-widget-area',  
  202. 'description' => __( 'Footer Widget Area 4', 'advantage' ),  
  203. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',  
  204. 'after_widget' => '</li>',  
  205. 'before_title' => '<h5 class="widget-title">',  
  206. 'after_title' => '</h5>',  
  207. ) ); 
  208. /** Register sidebars by running advantage_widgets_init() on the widgets_init hook. */ 
  209. add_action( 'widgets_init', 'advantage_widgets_init' ); 
  210.  
  211. if ( ! function_exists( 'advantage_header_style' ) ) : 
  212. function advantage_header_style() { 
  213. $text_color = get_header_textcolor(); 
  214. if ( $text_color == HEADER_TEXTCOLOR ) //Default Text Color. Doing Nothing 
  215. return; 
  216. ?> 
  217. <style type="text/css"> 
  218. <?php 
  219. if ( 'blank' == $text_color ) { // Blog Text is unchecked 
  220. ?> 
  221. #site-title,  
  222. #site-description { 
  223. position: absolute !important; 
  224. clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ 
  225. clip: rect(1px, 1px, 1px, 1px); 
  226. <?php 
  227. } else { // Custom color 
  228. ?> 
  229. #site-title a,  
  230. #site-description { 
  231. color: #<?php echo $text_color; ?> !important; 
  232. <?php 
  233. ?> 
  234. </style> 
  235. <?php 
  236. endif; 
  237.  
  238. if ( ! function_exists( 'advantage_comment' ) ) : 
  239. function advantage_comment( $comment, $args, $depth ) { 
  240. $GLOBALS['comment'] = $comment; 
  241. switch ( $comment->comment_type ) { 
  242. case 'pingback' : 
  243. case 'trackback' : 
  244. ?> 
  245. <li class="post pingback"> 
  246. <p><?php _e( 'Pingback:', 'advantage' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( '<i class="icon-pencil"></i> ' . __( '[Edit]', 'advantage' ), ' ' ); ?></p> 
  247. <?php 
  248. break; 
  249. default : 
  250. ?> 
  251. <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>"> 
  252. <article id="comment-<?php comment_ID(); ?>" class="comment"> 
  253. <footer> 
  254. <div class="comment-meta"> 
  255. <?php echo get_avatar( $comment, 40 ); 
  256. printf( '<cite class="fn">%1$s</cite>', get_comment_author_link() ); ?> 
  257. <a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><time pubdate datetime="<?php comment_time( 'c' ); ?>"> 
  258. <?php 
  259. printf( __( '%1$s at %2$s', 'advantage' ), get_comment_date(), get_comment_time() ); ?> 
  260. </time></a> 
  261. <?php edit_comment_link( '<i class="icon-pencil"></i> ' . __( '[Edit]', 'advantage' ), ' ' );  
  262. if ( $comment->comment_approved == '0' ) { ?> 
  263. <em><?php _e( 'Your comment is awaiting moderation.', 'advantage' ); ?></em> 
  264. <?php }; ?> 
  265. </div> 
  266. </footer> 
  267. <div class="comment-content"><?php comment_text(); ?></div> 
  268. <div class="reply"> 
  269. <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> 
  270. </div> 
  271. </article> 
  272. <?php 
  273. break; 
  274. endif; 
  275.  
  276. function advantage_excerpt_length( $length ) { 
  277. return 40; 
  278. add_filter( 'excerpt_length', 'advantage_excerpt_length' ); 
  279.  
  280. /** 
  281. * Returns a "Continue Reading" link for excerpts 
  282. * 
  283. */ 
  284. function advantage_continue_reading_link() { 
  285. global $post; 
  286. $readmore = get_post_meta( $post->ID, '_advantage_readmore', true ); 
  287. if ( empty( $readmore ) ) 
  288. $readmore = __( 'read more', 'advantage' ); 
  289. $link = ' <a class="more-link" href="'. get_permalink() . '">' . $readmore . '</a>'; 
  290. return $link; 
  291.  
  292. function advantage_auto_excerpt_more( $more ) { 
  293. return ' …'; 
  294. add_filter( 'excerpt_more', 'advantage_auto_excerpt_more' ); 
  295.  
  296. function advantage_custom_excerpt_more( $output ) { 
  297. if ( ! is_attachment() ) { 
  298. $output .= advantage_continue_reading_link(); 
  299. return $output; 
  300. add_filter( 'get_the_excerpt', 'advantage_custom_excerpt_more' ); 
  301.  
  302. if ( ! function_exists( 'advantage_content_nav' ) ) : 
  303. /** Pagination for main loop */ 
  304. function advantage_content_nav( $nav_id ) { 
  305. global $wp_query; 
  306. advantage_content_nav_link( $wp_query->max_num_pages, $nav_id ); 
  307. endif; 
  308.  
  309. if ( ! function_exists( 'advantage_content_nav_link' ) ) : 
  310. /** Pagination */ 
  311. function advantage_content_nav_link( $num_of_pages, $nav_id ) { 
  312. if ( $num_of_pages > 1 ) { 
  313. echo '<nav id="' . $nav_id . '">'; 
  314. echo '<div class="pagination pagination-centered">'; 
  315.  
  316. $big = 999999999; 
  317. if ( get_query_var( 'paged' ) ) 
  318. $current_page = get_query_var( 'paged' ); 
  319. elseif ( get_query_var( 'page' ) )  
  320. $current_page = get_query_var( 'page' ); 
  321. else  
  322. $current_page = 1; 
  323. $links = paginate_links( array( 
  324. 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),  
  325. 'format' => '?paged=%#%',  
  326. 'current' => max( 1, $current_page ),  
  327. 'total' => $num_of_pages,  
  328. 'mid_size' => 3,  
  329. 'prev_text' => '<i class="icon-chevron-left"></i>' ,  
  330. 'next_text' => '<i class="icon-chevron-right"></i>' ,  
  331. 'type' => 'array' ) ); 
  332. echo '<ul><li><span>' . __( 'Page', 'voyage' ) . '</span></li>'; 
  333. foreach ( $links as $link ) 
  334. printf( '<li>%1$s</li>', $link ); 
  335. echo '</ul></div></nav>'; 
  336. endif; 
  337.  
  338. /** 
  339. * Replace rel="category tag" with rel="tag" 
  340. * For W3C validation purposes only. 
  341. */ 
  342. function advantage_replace_rel_category ($output) { 
  343. $output = str_replace(' rel="category tag"', ' rel="tag"', $output); 
  344. return $output; 
  345. add_filter('wp_list_categories', 'advantage_replace_rel_category'); 
  346. add_filter('the_category', 'advantage_replace_rel_category'); 
  347.  
  348. if ( ! function_exists( 'advantage_meta_category' ) ) : 
  349. // Prints Post Categories 
  350. function advantage_meta_category( $meta_icon = 0 ) { 
  351. $categories = wp_get_post_categories( get_the_ID() , array('fields' => 'ids')); 
  352. if( $categories ) { 
  353. $sep = ' • '; 
  354. $cat_ids = implode( ', ' , $categories ); 
  355. $cats = wp_list_categories( 'title_li=&style=none&echo=0&include='.$cat_ids); 
  356. $cats = rtrim( trim( str_replace( '<br />', $sep, $cats) ), $sep); 
  357. echo '<span class="entry-category">'; 
  358. if ( 1 == $meta_icon ) 
  359. echo '<i class="icon-folder-open meta-icon"></i>'; 
  360. else 
  361. echo '<span class="meta-prep">' . __( 'Filed in ', 'advantage') . '</span>';  
  362. echo $cats; 
  363. echo '</span>'; 
  364. endif; 
  365.  
  366. if ( ! function_exists( 'advantage_meta_author' ) ) : 
  367. function advantage_meta_author( $meta_icon = 0 ) { 
  368. printf( '<span class="by-author"><span class="meta-prep">%4$s</span><a class="url fn n" href="%1$s" title="%2$s" rel="author"> %3$s</a></span>',  
  369. esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),  
  370. esc_attr( sprintf( __( 'View all posts by %s', 'advantage' ), get_the_author() ) ),  
  371. get_the_author(),  
  372. $meta_icon ? '<i class="icon-user meta-icon"></i>' : 'By' ); 
  373. endif; 
  374.  
  375.  
  376. if ( ! function_exists( 'advantage_meta_comment' ) ) : 
  377. // Prints Comments Link 
  378. function advantage_meta_comment( $meta_icon = 0 ) { 
  379. if ( comments_open() && ! post_password_required() ) { 
  380. $comment_icon = '<i class="icon-comment meta-icon"></i>'; 
  381. printf( '<span class="meta-comment">' ); 
  382. comments_popup_link( $comment_icon . __( 'Comment', 'advantage' ), $comment_icon . __( '1 Comment', 'advantage' ) , $comment_icon . __( '% Comments', 'advantage' ) );  
  383. printf( '</span>' ); 
  384. endif; 
  385.  
  386. if ( ! function_exists( 'advantage_meta_date' ) ) : 
  387. // Prints Post Date 
  388. function advantage_meta_date( $meta_icon = 0 ) { 
  389. if ( $meta_icon ) 
  390. echo '<i class="icon-calendar meta-icon"></i>'; 
  391. printf( __( '<time class="entry-date" datetime="%1$s">%2$s</time>', 'advantage' ),  
  392. esc_attr( get_the_date( 'c' ) ),  
  393. esc_html( get_the_date() ) );  
  394.  
  395. endif; 
  396.  
  397. if ( ! function_exists( 'advantage_meta_tag' ) ) : 
  398. // Prints Post Tags 
  399. function advantage_meta_tag( $meta_icon = 0 ) { 
  400. $tags_list = get_the_tag_list( '', __( ' • ', 'advantage' ) ); 
  401. if ( $tags_list ) { 
  402. echo '<span class="entry-tags"><i class="icon-tags meta-icon"> </i>'; 
  403. printf( '<span class="entry-tag">%1$s</span>',  
  404. $tags_list ); 
  405. echo '</span>'; 
  406. }  
  407. endif; 
  408.  
  409. if ( ! function_exists( 'advantage_post_meta_top' ) ) : 
  410. function advantage_post_meta_top() { 
  411. if ( 'post' == get_post_type() && ! is_single() ) { 
  412. echo '<span class="entry-meta entry-meta-top">';  
  413. if ( is_sticky() ) { 
  414. printf( '<span class="entry-featured">%1$s •</span>', __( 'Featured ', 'advantage') ); 
  415. advantage_meta_category();  
  416. echo '</span>';  
  417. endif; 
  418.  
  419. if ( ! function_exists( 'advantage_post_meta' ) ) : 
  420. function advantage_post_meta() { 
  421. if ( 'post' == get_post_type() ) { 
  422. echo '<span class="entry-meta">'; 
  423. advantage_meta_date(); 
  424. advantage_meta_author(); 
  425. if ( is_single() ) { 
  426. advantage_meta_category();  
  427. advantage_meta_comment();  
  428. echo '</span>';  
  429. endif; 
  430.  
  431. if ( ! function_exists( 'advantage_post_tag' ) ) : 
  432. // Prints tages, edit link at the bottom of the post 
  433. function advantage_post_tag() { 
  434. printf ('<div class="entry-meta entry-meta-bottom">');  
  435. if ( 'post' == get_post_type() ) 
  436. advantage_meta_tag(); 
  437. /** if ( is_singular() && ! is_home() ) 
  438. printf( __(' <a href="%1$s" title="Permalink to %2$s" rel="bookmark">Permalink</a>', 'advantage' ),  
  439. esc_url( get_permalink() ),  
  440. the_title_attribute( 'echo=0' ) 
  441. ); */ 
  442. edit_post_link( '<i class="icon-pencil"></i> ' . __( '[Edit]', 'advantage' ), '<span class="edit-link">', '</span>' ); 
  443. echo '</div>';  
  444. endif; 
  445.  
  446. if ( ! function_exists( 'advantage_post_summary_meta' ) ) : 
  447. // Prints meta info for Post Summary 
  448. function advantage_post_summary_meta( $meta_flag = 0 ) { 
  449. global $advantage_entry_meta; 
  450.  
  451. echo '<div class="entry-meta entry-meta-summary clearfix">'; 
  452. if ( ( $advantage_entry_meta || $meta_flag ) && 'post' == get_post_type() ) { 
  453. advantage_meta_date( $meta_flag ); 
  454. advantage_meta_author( $meta_flag ); 
  455. advantage_meta_category( $meta_flag ); 
  456. advantage_meta_tag( $meta_flag ); 
  457. advantage_meta_comment( $meta_flag ); 
  458. edit_post_link( '<i class="icon-pencil"></i> ' . __( '[Edit]', 'advantage' ), '<span class="edit-link">', '</span>' );  
  459. echo '</div>';  
  460. endif; 
  461.  
  462. function advantage_body_classes( $classes ) { 
  463. global $advantage_options, $advantage_layout; 
  464.  
  465. if ( ! is_single() ) 
  466. $classes[] = 'multi'; 
  467. elseif ( 2 == $advantage_layout ) 
  468. $classes[] = 'fullscreen'; 
  469.  
  470. if ( is_page_template( 'pages/featured.php' ) 
  471. || ( is_home() && 1 == $advantage_options['homepage'] ) ) 
  472. $classes[] = 'featured-home'; 
  473.  
  474. return $classes; 
  475. add_filter( 'body_class', 'advantage_body_classes' ); 
  476.  
  477. function advantage_scripts_method() {  
  478. global $advantage_options, $advantage_fonts; 
  479.  
  480. $theme_uri = get_template_directory_uri(); 
  481. // Check if the fonts are webfont, if yes, load the font. 
  482. $advantage_fonts = advantage_fonts_array(); 
  483. $font_elements = array( 
  484. 'bodyfont', 'headingfont', 'entrytitlefont',  
  485. 'sitetitlefont', 'sitedescfont', 'mainmenufont',  
  486. 'sidebarfont', 'widgettitlefont', 'footerfont' 
  487. ); 
  488. $fonts = array(); 
  489. foreach ( $font_elements as $element ) { 
  490. if ( $advantage_options[$element] > 0 
  491. && ! in_array( $advantage_options[ $element ], $fonts) ) 
  492. $fonts[] = $advantage_options[ $element ];  
  493.  
  494. foreach ( $fonts as $font ) { 
  495. if ( ! empty( $advantage_fonts[ $font ]['url'] ) ) 
  496. wp_enqueue_style( str_replace(' ', '', $advantage_fonts[ $font ]['label']), $advantage_fonts[ $font ]['url'], false, 1.0 ); 
  497.  
  498. wp_enqueue_style('bootstrap', $theme_uri . '/css/bootstrap.min.css', null, '2.3.1'); 
  499. wp_enqueue_style('fontawesome', $theme_uri . '/css/font-awesome.min.css', array( 'bootstrap' ), '3.0.2' ); 
  500. wp_enqueue_style('advantage', $theme_uri . '/dev/advantage.css', array( 'bootstrap', 'fontawesome' ), ADVANTAGE_VERSION); 
  501. $child_pre = array( 'advantage' ); 
  502. // Load Scheme CSS 
  503. if ( ! empty( $advantage_options['schemecss'] ) ) { 
  504. wp_enqueue_style('advantage-scheme', $advantage_options['schemecss'], $child_pre, ADVANTAGE_VERSION ); 
  505. $child_pre[] = 'advantage-scheme';  
  506. //Load child theme's style.css 
  507. if ( $theme_uri != get_stylesheet_directory_uri() ) 
  508. wp_enqueue_style('advantage-child', get_stylesheet_uri(), $child_pre, ADVANTAGE_VERSION ); 
  509.  
  510. // Page Template specific 
  511. if ( is_page_template( 'pages/portfolio.php' ) ) { 
  512. wp_enqueue_script( 'infinite-scroll' , $theme_uri . '/js/jquery.infinitescroll.min.js', array( 'jquery-masonry' ), '2.0', true );  
  513. $advantage_dep[] = 'infinite-scroll'; 
  514. }  
  515. //Scripts 
  516. if ( is_singular() && get_option( 'thread_comments' ) ) 
  517. wp_enqueue_script( 'comment-reply' );  
  518. wp_enqueue_script( 'modernizr' , $theme_uri . '/js/modernizr.custom.js', null ); 
  519. wp_enqueue_script( 'bootstrap' , $theme_uri . '/js/bootstrap.min.js', array( 'jquery'), '2.3.1', true ); 
  520. wp_enqueue_script( 'advantage' , $theme_uri . '/js/advantage.js', array( 'bootstrap'), ADVANTAGE_VERSION, true ); 
  521. if ( ! is_admin() ) 
  522. add_action( 'wp_enqueue_scripts', 'advantage_scripts_method' );  
  523.  
  524. require( get_template_directory() . '/inc/hooks.php' ); 
  525. require( get_template_directory() . '/inc/lib-foundation.php' ); 
  526. require( get_template_directory() . '/inc/lib-general.php' ); 
  527. require( get_template_directory() . '/inc/lib-functions.php' ); 
  528. require( get_template_directory() . '/inc/lib-content.php' ); 
  529. require( get_template_directory() . '/inc/widgets.php' ); 
  530. require( get_template_directory() . '/scheme/scheme.php' ); 
  531. if ( is_admin() ) { 
  532. require( get_template_directory() . '/inc/lib-admin.php' ); 
  533. require( get_template_directory() . '/inc/theme-options.php' ); 
  534.  
  535. $advantage_options = advantage_get_options(); //Global Theme Options 
.