Guest User

Untitled

a guest
Oct 18th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 65.12 KB | None | 0 0
  1. <?php
  2. $woo_options = get_option( 'woo_options' );
  3.  
  4. /*------------------------------------------------------------------------------------
  5.  
  6. TABLE OF CONTENTS
  7.  
  8. - Theme Setup
  9. - Woo Conditionals
  10. - Add custom styling
  11. - Add layout to body_class output
  12. - WooSlider Setup
  13. - WooSlider Magazine template
  14. - Navigation
  15. - Post More
  16. - Video Embed
  17. - Single Post Author
  18. - Yoast Breadcrumbs
  19. - Subscribe & Connect
  20. - Optional Top Navigation (WP Menus)
  21. - Footer Widgetized Areas
  22. - Add customisable footer areas
  23. - Add customisable post meta
  24. - Add Post Thumbnail to Single posts on Archives
  25. - Post Inside After
  26. - Modify the default "comment" form field.
  27. - Add theme default comment form fields.
  28. - Add theme default comment form arguments.
  29. - Activate shortcode compatibility in our new custom areas.
  30. - woo_content_templates_magazine()
  31. - woo_feedburner_link()
  32.  
  33. ------------------------------------------------------------------------------------*/
  34.  
  35. add_action( 'wp_head','woo_custom_styling', 10 ); // Add custom styling
  36. add_filter( 'body_class','woo_layout_body_class', 10 ); // Add layout to body_class output
  37. add_action( 'woo_head','woo_slider', 10 ); // WooSlider Setup
  38. add_action( 'woo_header_after','woo_nav', 10 ); // Navigation
  39. add_action( 'woo_nav_inside','woo_nav_subscribe', 10 ); // Subscribe links in navigation
  40. add_action( 'woo_head', 'woo_conditionals', 10 ); // Woo Conditionals
  41. add_action( 'wp_head', 'woo_author', 10 ); // Author Box
  42. add_action( 'woo_post_after', 'woo_postnav', 10 ); // Single post navigation
  43. add_action( 'wp_head', 'woo_google_webfonts', 10 ); // Add Google Fonts output to HEAD
  44.  
  45. if ( @$woo_options['woo_breadcrumbs_show'] == 'true' ) {
  46. add_action( 'woo_loop_before', 'woo_breadcrumbs', 10 ); // Breadcrumbs
  47. } // End IF Statement
  48.  
  49. add_action( 'wp_head', 'woo_subscribe_connect_action', 10 ); // Subscribe & Connect
  50. add_action( 'woo_top', 'woo_top_navigation', 10 ); // Optional Top Navigation (WP Menus)
  51.  
  52. /*-----------------------------------------------------------------------------------*/
  53. /* Theme Setup */
  54. /*-----------------------------------------------------------------------------------*/
  55. /**
  56. * Theme Setup
  57. *
  58. * This is the general theme setup, where we add_theme_support(), create global variables
  59. * and setup default generic filters and actions to be used across our theme.
  60. *
  61. * @package WooFramework
  62. * @subpackage Logic
  63. */
  64.  
  65. /**
  66. * Set the content width based on the theme's design and stylesheet.
  67. *
  68. * Used to set the width of images and content. Should be equal to the width the theme
  69. * is designed for, generally via the style.css stylesheet.
  70. */
  71.  
  72. if ( ! isset( $content_width ) ) $content_width = 640;
  73.  
  74. /**
  75. * Sets up theme defaults and registers support for various WordPress features.
  76. *
  77. * Note that this function is hooked into the after_setup_theme hook, which runs
  78. * before the init hook. The init hook is too late for some features, such as indicating
  79. * support for post thumbnails.
  80. *
  81. * To override woothemes_setup() in a child theme, add your own woothemes_setup to your child theme's
  82. * functions.php file.
  83. *
  84. * @uses add_theme_support() To add support for post thumbnails and automatic feed links.
  85. * @uses add_editor_style() To style the visual editor.
  86. */
  87.  
  88. add_action( 'after_setup_theme', 'woothemes_setup' );
  89.  
  90. if ( ! function_exists( 'woothemes_setup' ) ) {
  91. function woothemes_setup () {
  92.  
  93. // This theme styles the visual editor with editor-style.css to match the theme style.
  94. add_editor_style();
  95.  
  96. // This theme uses post thumbnails
  97. add_theme_support( 'post-thumbnails' );
  98.  
  99. // Add default posts and comments RSS feed links to head
  100. add_theme_support( 'automatic-feed-links' );
  101.  
  102. } // End woothemes_setup()
  103. } // End IF Statement
  104.  
  105. /*-----------------------------------------------------------------------------------*/
  106. /* Woo Conditinals */
  107. /*-----------------------------------------------------------------------------------*/
  108. if (!function_exists('woo_conditionals')) {
  109. function woo_conditionals() {
  110.  
  111. // Video Embed
  112. if( is_single() && ( get_post_type() != 'portfolio' ) ) {
  113. add_action('woo_post_inside_before','canvas_get_embed');
  114. }
  115.  
  116. // Post More
  117. if ( ! is_singular() && !is_404() || is_page_template('template-blog.php') || is_page_template( 'template-magazine.php' ) ) {
  118. add_action('woo_post_inside_after','woo_post_more');
  119. }
  120.  
  121. // Tumblog Content
  122. if (get_option('woo_woo_tumblog_switch') == 'true') {
  123. add_action('woo_tumblog_content_before','woo_tumblog_content');
  124. add_action('woo_tumblog_content_after','woo_tumblog_content');
  125. }
  126.  
  127. }
  128. }
  129.  
  130.  
  131. /*-----------------------------------------------------------------------------------*/
  132. /* // Add custom styling */
  133. /*-----------------------------------------------------------------------------------*/
  134. if (!function_exists('woo_custom_styling')) {
  135. function woo_custom_styling() {
  136.  
  137. global $woo_options;
  138. $output = '';
  139.  
  140. // Logo
  141. if ( !$woo_options['woo_logo'] )
  142. $output .= '#logo .site-title, #logo .site-description { display:block; }' . "\n";
  143.  
  144. // Styling options output in header
  145. if ( $woo_options['woo_style_disable'] <> "true" ) :
  146.  
  147. // Layout styling
  148. $bg = $woo_options['woo_style_bg'];
  149. $bg_image = $woo_options['woo_style_bg_image'];
  150. $bg_image_repeat = $woo_options['woo_style_bg_image_repeat'];
  151. $border_top = $woo_options['woo_border_top'];
  152. $border_general = $woo_options['woo_style_border'];
  153.  
  154. $body = '';
  155. if ($bg)
  156. $body .= 'background-color:'.$bg.';';
  157. if ($bg_image)
  158. $body .= 'background-image:url('.$bg_image.');';
  159. if ($bg_image_repeat)
  160. $body .= 'background-repeat:'.$bg_image_repeat.';background-position:top center;';
  161. if ($border_top && $border_top['width'] >= 0)
  162. $body .= 'border-top:'.$border_top["width"].'px '.$border_top["style"].' '.$border_top["color"].';';
  163.  
  164. if ( $body != '' )
  165. $output .= 'body {'. $body . '}'. "\n";
  166.  
  167. if ( $border_general )
  168. $output .= 'hr, .entry img, img.thumbnail, .entry .wp-caption, #footer-widgets, #comments, #comments .comment.thread-even, #comments ul.children li, .entry h1{border-color:'. $border_general . '}'. "\n";
  169.  
  170.  
  171. // General styling
  172. $link = $woo_options['woo_link_color'];
  173. $hover = $woo_options['woo_link_hover_color'];
  174. $button = $woo_options['woo_button_color'];
  175.  
  176. if ($link)
  177. $output .= 'a:link, a:visited {color:'.$link.'}' . "\n";
  178. if ($hover)
  179. $output .= 'a:hover, .post-more a:hover, .post-meta a:hover, .post p.tags a:hover {color:'.$hover.'}' . "\n";
  180. if ($button)
  181. $output .= '.button, .reply a {background-color:'.$button.'}' . "\n";
  182.  
  183. // Header styling
  184. $header_bg = $woo_options['woo_header_bg'];
  185. $header_bg_image = $woo_options['woo_header_bg_image'];
  186. $header_bg_image_repeat = $woo_options['woo_header_bg_image_repeat'];
  187. $header_border = $woo_options['woo_header_border'];
  188. $header_margin_top = $woo_options['woo_header_margin_top'];
  189. $header_margin_bottom = $woo_options['woo_header_margin_bottom'];
  190. $header_padding_top = $woo_options['woo_header_padding_top'];
  191. $header_padding_bottom = $woo_options['woo_header_padding_bottom'];
  192. $header_padding_left = $woo_options['woo_header_padding_left'];
  193. $header_padding_right = $woo_options['woo_header_padding_right'];
  194. $font_logo = $woo_options['woo_font_logo'];
  195. $font_desc = $woo_options['woo_font_desc'];
  196.  
  197. $header_css = '';
  198. if ( $header_bg )
  199. $header_css .= 'background-color:'.$header_bg.';';
  200. if ( $header_bg_image )
  201. $header_css .= 'background-image:url('.$header_bg_image.');';
  202. if ( $header_bg_image_repeat )
  203. $header_css .= 'background-repeat:'.$header_bg_image_repeat.';background-position:top center;';
  204. if ( $header_margin_top <> '' || $header_margin_bottom <> '' )
  205. $header_css .= 'margin-top:'.$header_margin_top.'px;margin-bottom:'.$header_margin_bottom.'px;';
  206. if ( $header_padding_top <> '' || $header_padding_bottom <> '' )
  207. $header_css .= 'padding-top:'.$header_padding_top.'px;padding-bottom:'.$header_padding_bottom.'px;';
  208. if ( $header_border && $header_border['width'] >= 0)
  209. $header_css .= 'border:'.$header_border["width"].'px '.$header_border["style"].' '.$header_border["color"].';';
  210. if ( $header_border && $header_border['width'] > 0) {
  211. $width = get_option('woo_layout_width') - $header_border['width']*2;
  212. if ( $width > 0 )
  213. $header_css .= 'width:'.$width.'px;';
  214. }
  215. if ( $header_css != '' )
  216. $output .= '#header {'. $header_css . '}'. "\n";
  217.  
  218. if ( $header_padding_left <> '' )
  219. $output .= '#logo {padding-left:'.$header_padding_left.'px;}';
  220. if ( $header_padding_right <> '' )
  221. $output .= '#topad {padding-right:'.$header_padding_right.'px;}'. "\n";
  222. if ( $font_logo )
  223. $output .= '#logo .site-title a {' . woo_generate_font_css( $font_logo ) . '}' . "\n";
  224. if ( $font_desc )
  225. $output .= '#logo .site-description {' . woo_generate_font_css( $font_desc ) . '}' . "\n";
  226.  
  227.  
  228. // Boxed styling
  229. $boxed = $woo_options['woo_layout_boxed'];
  230. $box_bg = $woo_options['woo_style_box_bg'];
  231. $box_margin_top = $woo_options['woo_box_margin_top'];
  232. $box_margin_bottom = $woo_options['woo_box_margin_bottom'];
  233. $box_border_tb = $woo_options['woo_box_border_tb'];
  234. $box_border_lr = $woo_options['woo_box_border_lr'];
  235. $box_border_radius = $woo_options['woo_box_border_radius'];
  236. $box_shadow = $woo_options['woo_box_shadow'];
  237.  
  238. $wrapper = '';
  239. if ($boxed == "true") {
  240. //$wrapper .= 'margin:0 auto;padding:0 0 20px 0;width:'.get_option('woo_layout_width').';';
  241. if ( get_option('woo_layout_width') == '940px' )
  242. $wrapper .= 'padding-left:20px; padding-right:20px;';
  243. else
  244. $wrapper .= 'padding-left:30px; padding-right:30px;';
  245. }
  246. if ($boxed == "true" && $box_bg)
  247. $wrapper .= 'background-color:'.$box_bg.';';
  248. if ($boxed == "true" && ($box_margin_top || $box_margin_bottom) )
  249. $wrapper .= 'margin-top:'.$box_margin_top.'px;margin-bottom:'.$box_margin_bottom.'px;';
  250. if ($boxed == "true" && $box_border_tb["width"] > 0 )
  251. $wrapper .= 'border-top:'.$box_border_tb["width"].'px '.$box_border_tb["style"].' '.$box_border_tb["color"].';border-bottom:'.$box_border_tb["width"].'px '.$box_border_tb["style"].' '.$box_border_tb["color"].';';
  252. if ($boxed == "true" && $box_border_lr["width"] > 0 )
  253. $wrapper .= 'border-left:'.$box_border_lr["width"].'px '.$box_border_lr["style"].' '.$box_border_lr["color"].';border-right:'.$box_border_lr["width"].'px '.$box_border_lr["style"].' '.$box_border_lr["color"].';';
  254. if ( $boxed == "true" && $box_border_radius )
  255. $wrapper .= 'border-radius:'.$box_border_radius.';-moz-border-radius:'.$box_border_radius.';-webkit-border-radius:'.$box_border_radius.';';
  256. if ( $boxed == "true" && $box_shadow == "true" )
  257. $wrapper .= 'box-shadow: 0px 1px 5px rgba(0,0,0,.3);-moz-box-shadow: 0px 1px 5px rgba(0,0,0,.3);-webkit-box-shadow: 0px 1px 5px rgba(0,0,0,.3);';
  258.  
  259. if ( $wrapper != '' )
  260. $output .= '#wrapper {'. $wrapper . '}'. "\n";
  261.  
  262. // General Typography
  263. $font_text = $woo_options['woo_font_text'];
  264. $font_h1 = $woo_options['woo_font_h1'];
  265. $font_h2 = $woo_options['woo_font_h2'];
  266. $font_h3 = $woo_options['woo_font_h3'];
  267. $font_h4 = $woo_options['woo_font_h4'];
  268. $font_h5 = $woo_options['woo_font_h5'];
  269. $font_h6 = $woo_options['woo_font_h6'];
  270.  
  271. if ( $font_text )
  272. $output .= 'body, p { ' . woo_generate_font_css( $font_text, 1.5 ) . ' }' . "\n";
  273. if ( $font_h1 )
  274. $output .= 'h1 { ' . woo_generate_font_css( $font_h1, 1.5 ) . ' }';
  275. if ( $font_h2 )
  276. $output .= 'h2 { ' . woo_generate_font_css( $font_h2, 1.5 ) . ' }';
  277. if ( $font_h3 )
  278. $output .= 'h3 { ' . woo_generate_font_css( $font_h3, 1.5 ) . ' }';
  279. if ( $font_h4 )
  280. $output .= 'h4 { ' . woo_generate_font_css( $font_h4, 1.5 ) . ' }';
  281. if ( $font_h5 )
  282. $output .= 'h5 { ' . woo_generate_font_css( $font_h5, 1.5 ) . ' }';
  283. if ( $font_h6 )
  284. $output .= 'h6 { ' . woo_generate_font_css( $font_h6, 1.5 ) . ' }' . "\n";
  285.  
  286. // Post Styling
  287. $font_post_title = $woo_options['woo_font_post_title'];
  288. $font_post_meta = $woo_options['woo_font_post_meta'];
  289. $font_post_text = $woo_options['woo_font_post_text'];
  290. $font_post_more = $woo_options['woo_font_post_more'];
  291. $post_more_border_top = $woo_options['woo_post_more_border_top'];
  292. $post_more_border_bottom = $woo_options['woo_post_more_border_bottom'];
  293. $post_comments_bg = $woo_options['woo_post_comments_bg'];
  294. $post_author_border_top = $woo_options['woo_post_author_border_top'];
  295. $post_author_border_bottom = $woo_options['woo_post_author_border_bottom'];
  296. $post_author_bg = $woo_options['woo_post_author_bg'];
  297.  
  298. if ( $font_post_title )
  299. $output .= '.post .title, .page .title, .post .title a:link, .post .title a:visited, .page .title a:link, .page .title a:visited {'.woo_generate_font_css( $font_post_title, 1.2 ).'}' . "\n";
  300. if ( $font_post_meta )
  301. $output .= '.post-meta { ' . woo_generate_font_css( $font_post_meta, 1.5 ) . ' }' . "\n";
  302. if ( $font_post_text )
  303. $output .= '.entry, .entry p{ ' . woo_generate_font_css( $font_post_text, 1.5 ) . ' }' . "\n";
  304. $post_more_border = '';
  305. if ( $font_post_more )
  306. $post_more_border .= 'font:'.$font_post_more["style"].' '.$font_post_more["size"].$font_post_more["unit"].'/1.5em '.stripslashes($font_post_more["face"]).';color:'.$font_post_more["color"].';';
  307. if ( $post_more_border_top )
  308. $post_more_border .= 'border-top:'.$post_more_border_top["width"].'px '.$post_more_border_top["style"].' '.$post_more_border_top["color"].';';
  309. if ( $post_more_border_bottom )
  310. $post_more_border .= 'border-bottom:'.$post_more_border_bottom["width"].'px '.$post_more_border_bottom["style"].' '.$post_more_border_bottom["color"].';';
  311. if ( $post_more_border )
  312. $output .= '.post-more {'.$post_more_border .'}' . "\n";
  313.  
  314. if ( $post_comments_bg )
  315. $output .= '#comments .comment.thread-even {background-color:'.$post_comments_bg.';}' . "\n";
  316.  
  317. $post_author = '';
  318. if ( $post_author_border_top )
  319. $post_author .= 'border-top:'.$post_author_border_top["width"].'px '.$post_author_border_top["style"].' '.$post_author_border_top["color"].';';
  320. if ( $post_author_border_bottom )
  321. $post_author .= 'border-bottom:'.$post_author_border_bottom["width"].'px '.$post_author_border_bottom["style"].' '.$post_author_border_bottom["color"].';';
  322. if ( $post_author_bg )
  323. $post_author .= 'background-color:'.$post_author_bg;
  324.  
  325. if ( $post_author )
  326. $output .= '#post-author, #connect {'.$post_author .'}' . "\n";
  327.  
  328. if ( $post_comments_bg )
  329. $output .= '#comments .comment.thread-even {background-color:'.$post_comments_bg.';}' . "\n";
  330.  
  331. // Page Nav Styling
  332. $pagenav_font = $woo_options['woo_pagenav_font'];
  333. $pagenav_bg = $woo_options['woo_pagenav_bg'];
  334. $pagenav_border_top = $woo_options['woo_pagenav_border_top'];
  335. $pagenav_border_bottom = $woo_options['woo_pagenav_border_bottom'];
  336.  
  337. $pagenav_css = '';
  338. if ( $pagenav_bg )
  339. $pagenav_css .= 'background-color:'.$pagenav_bg.';';
  340. if ( $pagenav_border_top && $pagenav_border_top["width"] > 0 )
  341. $pagenav_css .= 'border-top:'.$pagenav_border_top["width"].'px '.$pagenav_border_top["style"].' '.$pagenav_border_top["color"].';';
  342. if ( $pagenav_border_bottom && $pagenav_border_bottom["width"] > 0 )
  343. $pagenav_css .= 'border-bottom:'.$pagenav_border_bottom["width"].'px '.$pagenav_border_bottom["style"].' '.$pagenav_border_bottom["color"].';';
  344. if ( $pagenav_css != '' )
  345. $output .= '.nav-entries, .wp-pagenavi, .woo-pagination {'. $pagenav_css . ' padding: 12px 0px; }'. "\n";
  346. if ( $pagenav_font ) {
  347. $output .= '.nav-entries a, .wp-pagenavi a:link, .wp-pagenavi a:visited, .wp-pagenavi .current, .wp-pagenavi .on, .wp-pagenavi a:hover, .wp-pagenavi span.extend, .wp-pagenavi span.pages, .woo-pagination { ' . woo_generate_font_css( $pagenav_font ) . ' }' . "\n";
  348. $output .= '.wp-pagenavi a:link, .wp-pagenavi a:visited, .woo-pagination a, .woo-pagination a:hover, .wp-pagenavi span.extend, .wp-pagenavi span.pages, .wp-pagenavi span.current {color:'.$pagenav_font["color"].'!important}' . "\n";
  349. }
  350. // Widget Styling
  351. $widget_font_title = $woo_options['woo_widget_font_title'];
  352. $widget_font_text = $woo_options['woo_widget_font_text'];
  353. $widget_padding_tb = $woo_options['woo_widget_padding_tb'];
  354. $widget_padding_lr = $woo_options['woo_widget_padding_lr'];
  355. $widget_bg = $woo_options['woo_widget_bg'];
  356. $widget_border = $woo_options['woo_widget_border'];
  357. $widget_title_border = $woo_options['woo_widget_title_border'];
  358. $widget_border_radius = $woo_options['woo_widget_border_radius'];
  359.  
  360. $h3_css = '';
  361. if ( $widget_font_title )
  362. $h3_css .= 'font:'.$widget_font_title["style"].' '.$widget_font_title["size"].$widget_font_title["unit"].'/1.5em '.stripslashes($widget_font_title["face"]).';color:'.$widget_font_title["color"].';';
  363. if ( $widget_title_border )
  364. $h3_css .= 'border-bottom:'.$widget_title_border["width"].'px '.$widget_title_border["style"].' '.$widget_title_border["color"].';';
  365. if ( isset( $widget_title_border["width"] ) AND $widget_title_border["width"] == 0 )
  366. $h3_css .= 'margin-bottom:0;';
  367.  
  368. if ( $h3_css != '' )
  369. $output .= '.widget h3 {'. $h3_css . '}'. "\n";
  370.  
  371. if ( $widget_title_border )
  372. $output .= '.widget_recent_comments li, #twitter li { border-color: '.$widget_title_border["color"].';}'. "\n";
  373.  
  374. if ( $widget_font_text )
  375. $output .= '.widget p, .widget .textwidget { ' . woo_generate_font_css( $widget_font_text, 1.5 ) . ' }' . "\n";
  376.  
  377. $widget_css = '';
  378. if ( $widget_font_text )
  379. $widget_css .= 'font:'.$widget_font_text["style"].' '.$widget_font_text["size"].$widget_font_text["unit"].'/1.5em '.stripslashes($widget_font_text["face"]).';color:'.$widget_font_text["color"].';';
  380. if ( $widget_padding_tb || $widget_padding_lr )
  381. $widget_css .= 'padding:'.$widget_padding_tb.'px '.$widget_padding_lr.'px;';
  382. if ( $widget_bg )
  383. $widget_css .= 'background-color:'.$widget_bg.';';
  384. if ( $widget_border["width"] > 0 )
  385. $widget_css .= 'border:'.$widget_border["width"].'px '.$widget_border["style"].' '.$widget_border["color"].';';
  386. if ( $widget_border_radius )
  387. $widget_css .= 'border-radius:'.$widget_border_radius.';-moz-border-radius:'.$widget_border_radius.';-webkit-border-radius:'.$widget_border_radius.';';
  388.  
  389. if ( $widget_css != '' )
  390. $output .= '.widget {'. $widget_css . '}'. "\n";
  391.  
  392. if ( $widget_border["width"] > 0 )
  393. $output .= '#tabs {border:'.$widget_border["width"].'px '.$widget_border["style"].' '.$widget_border["color"].';}'. "\n";
  394.  
  395. // Tabs Widget
  396. $widget_tabs_bg = $woo_options['woo_widget_tabs_bg'];
  397. $widget_tabs_bg_inside = $woo_options['woo_widget_tabs_bg_inside'];
  398. $widget_tabs_font = $woo_options['woo_widget_tabs_font'];
  399. $widget_tabs_font_meta = $woo_options['woo_widget_tabs_font_meta'];
  400.  
  401. if ( $widget_tabs_bg )
  402. $output .= '#tabs {background-color:'.$widget_tabs_bg.';}'. "\n";
  403. if ( $widget_tabs_bg_inside )
  404. $output .= '#tabs .inside, #tabs ul.wooTabs li a.selected, #tabs ul.wooTabs li a:hover {background-color:'.$widget_tabs_bg_inside.';}'. "\n";
  405. if ( $widget_tabs_font )
  406. $output .= '#tabs .inside li a { ' . woo_generate_font_css( $widget_tabs_font, 1.5 ) . ' }'. "\n";
  407. if ( $widget_tabs_font_meta )
  408. $output .= '#tabs .inside li span.meta, #tabs ul.wooTabs li a { ' . woo_generate_font_css( $widget_tabs_font_meta, 1.5 ) . ' }'. "\n";
  409.  
  410. //Navigation
  411. $nav_bg = $woo_options['woo_nav_bg'];
  412. $nav_font = $woo_options['woo_nav_font'];
  413. $nav_hover = $woo_options['woo_nav_hover'];
  414. $nav_currentitem = $woo_options['woo_nav_currentitem'];
  415. $nav_border_top = $woo_options['woo_nav_border_top'];
  416. $nav_border_bot = $woo_options['woo_nav_border_bot'];
  417. $nav_border_lr = $woo_options['woo_nav_border_lr'];
  418. $nav_border_radius = $woo_options['woo_nav_border_radius'];
  419.  
  420. $top_nav_bg = $woo_options['woo_top_nav_bg'];
  421. $top_nav_hover = $woo_options['woo_top_nav_hover'];
  422. $top_nav_font = $woo_options['woo_top_nav_font'];
  423.  
  424. if ( $nav_font )
  425. $output .= '.nav a, #navigation ul.rss a { ' . woo_generate_font_css( $nav_font ) . ' }' . "\n";
  426. if ( $nav_hover )
  427. $output .= '.nav li a:hover, .nav li.sfHover a.sf-with-ul {background-color:'.$nav_hover.'}' . "\n";
  428.  
  429. // If we have a hover colour and don't have a current item colour, we use the hover colour as current item colour.
  430. if ( $nav_currentitem == '' && $nav_hover != '' ) { $nav_currentitem = $nav_hover; }
  431.  
  432. if ( $nav_currentitem ) {
  433. $output .= '.nav li.current_page_item a, .nav li.current-menu-ancestor a, .nav li.selected, .nav li.current-menu-item a, .nav li.current_page_parent a { background-color:' . $nav_currentitem . '; }' . "\n";
  434. }
  435.  
  436. $navigation_css = '';
  437. if ( $nav_bg )
  438. $navigation_css .= 'background-color:'.$nav_bg.';';
  439. if ( $nav_border_top && $nav_border_top["width"] >= 0 )
  440. $navigation_css .= 'border-top:'.$nav_border_top["width"].'px '.$nav_border_top["style"].' '.$nav_border_top["color"].';border-bottom:'.$nav_border_bot["width"].'px '.$nav_border_bot["style"].' '.$nav_border_bot["color"].';border-left:'.$nav_border_lr["width"].'px '.$nav_border_lr["style"].' '.$nav_border_lr["color"].';border-right:'.$nav_border_lr["width"].'px '.$nav_border_lr["style"].' '.$nav_border_lr["color"].';';
  441. if ( $nav_border_radius )
  442. $navigation_css .= 'border-radius:'.$nav_border_radius.'; -moz-border-radius:'.$nav_border_radius.'; -webkit-border-radius:'.$nav_border_radius.';';
  443.  
  444. if ( $navigation_css != '' )
  445. $output .= '#navigation {'. $navigation_css . '}'. "\n";
  446.  
  447. if ( $top_nav_bg )
  448. $output .= '#top, #top .nav li ul li a:hover { background:'.$top_nav_bg.';}'. "\n";
  449.  
  450. if ( $top_nav_hover )
  451. $output .= '#top .nav a:hover, #top .nav li.current_page_item a, #top .nav li.current_page_parent a,#top .nav li.current-menu-ancestor a,#top .nav li.current-cat a,#top .nav li.current-menu-item a,#top .nav li.sfHover, #top .nav li ul{ background:'.$top_nav_hover.';}'. "\n";
  452.  
  453. if ( $top_nav_font )
  454. $output .= '#top .nav a { ' . woo_generate_font_css( $top_nav_font ) . ' }' . "\n";
  455.  
  456.  
  457. // Footer
  458. $footer_font = $woo_options['woo_footer_font'];
  459. $footer_bg = $woo_options['woo_footer_bg'];
  460. $footer_border_top = $woo_options['woo_footer_border_top'];
  461. $footer_border_bottom = $woo_options['woo_footer_border_bottom'];
  462. $footer_border_lr = $woo_options['woo_footer_border_lr'];
  463. $footer_border_radius = $woo_options['woo_footer_border_radius'];
  464.  
  465. if ( $footer_font )
  466. $output .= '#footer, #footer p { ' . woo_generate_font_css( $footer_font ) . ' }' . "\n";
  467. $footer_css = '';
  468. if ( $footer_bg )
  469. $footer_css .= 'background-color:'.$footer_bg.';';
  470. if ( $footer_border_top )
  471. $footer_css .= 'border-top:'.$footer_border_top["width"].'px '.$footer_border_top["style"].' '.$footer_border_top["color"].';';
  472. if ( $footer_border_bottom )
  473. $footer_css .= 'border-bottom:'.$footer_border_bottom["width"].'px '.$footer_border_bottom["style"].' '.$footer_border_bottom["color"].';';
  474. if ( $footer_border_lr )
  475. $footer_css .= 'border-left:'.$footer_border_lr["width"].'px '.$footer_border_lr["style"].' '.$footer_border_lr["color"].';border-right:'.$footer_border_lr["width"].'px '.$footer_border_lr["style"].' '.$footer_border_lr["color"].';';
  476. if ( $footer_border_radius )
  477. $footer_css .= 'border-radius:'.$footer_border_radius.'; -moz-border-radius:'.$footer_border_radius.'; -webkit-border-radius:'.$footer_border_radius.';';
  478.  
  479. if ( $footer_css != '' )
  480. $output .= '#footer {'. $footer_css . '}' . "\n";
  481.  
  482. // Magazine Template
  483. $slider_magazine_font_title = $woo_options['woo_slider_magazine_font_title'];
  484. $slider_magazine_font_excerpt = $woo_options['woo_slider_magazine_font_excerpt'];
  485.  
  486. if ( $slider_magazine_font_title )
  487. $output .= '.magazine #loopedSlider .content h2.title a { ' . woo_generate_font_css( $slider_magazine_font_title ) . ' }'. "\n";
  488. if ( $slider_magazine_font_excerpt )
  489. $output .= '.magazine #loopedSlider .content .excerpt p { ' . woo_generate_font_css( $slider_magazine_font_excerpt, 1.5 ) . ' }'. "\n";
  490.  
  491. // Business Template
  492. $slider_biz_font_title = $woo_options['woo_slider_biz_font_title'];
  493. $slider_biz_font_excerpt = $woo_options['woo_slider_biz_font_excerpt'];
  494.  
  495. if ( $slider_biz_font_title )
  496. $output .= '.business #loopedSlider .content h2.title a { ' . woo_generate_font_css( $slider_biz_font_title ) . ' }'. "\n";
  497. if ( $slider_biz_font_excerpt )
  498. $output .= '.business #loopedSlider .content p { ' . woo_generate_font_css( $slider_biz_font_excerpt, 1.5 ) . ' }'. "\n";
  499.  
  500. // Archive Header
  501. $woo_archive_header_font = $woo_options['woo_archive_header_font'];
  502. if ( $woo_archive_header_font )
  503. $output .= '.archive_header { ' . woo_generate_font_css( $woo_archive_header_font ) . 'border-bottom:'.$woo_options['woo_archive_header_border_bottom']["width"].'px '.$woo_options['woo_archive_header_border_bottom']["style"].' '.$woo_options['woo_archive_header_border_bottom']["color"].';}'. "\n";
  504. if ( $woo_options['woo_archive_header_disable_rss'] == "true" )
  505. $output .= '.archive_header .catrss { display:none; }' . "\n";
  506.  
  507. endif;
  508.  
  509. // Output styles
  510. if (isset($output)) {
  511. $output = "\n<!-- Woo Custom Styling -->\n<style type=\"text/css\">\n" . $output . "</style>\n<!-- /Woo Custom Styling -->\n\n";
  512. echo $output;
  513. }
  514.  
  515. }
  516. }
  517.  
  518. // Returns proper font css output
  519. if (!function_exists( 'woo_generate_font_css')) {
  520. function woo_generate_font_css($option, $em = '1') {
  521.  
  522. // Google Fonts
  523. global $google_fonts;
  524.  
  525. // check if font name has spaces
  526. if ( strpos( $option[ 'face' ], ' ' ) ) {
  527.  
  528. // test if font face is a Google font
  529. foreach ( $google_fonts as $fonts ) {
  530.  
  531. // Add single quotation marks to font name
  532. if ( $option[ 'face' ] == $fonts[ 'name' ] )
  533. $option[ 'face' ] = "'" . $option[ 'face' ] . "', arial, serif";
  534. }
  535.  
  536. } // ENDIF
  537.  
  538. return 'font:'.$option["style"].' '.$option["size"].$option["unit"].'/'.$em.'em '.stripslashes($option["face"]).';color:'.$option["color"].';';
  539. }
  540. }
  541.  
  542.  
  543. /*-----------------------------------------------------------------------------------*/
  544. /* Add layout to body_class output */
  545. /*-----------------------------------------------------------------------------------*/
  546. if ( ! function_exists( 'woo_layout_body_class' ) ) {
  547. function woo_layout_body_class( $classes ) {
  548.  
  549. $layout = '';
  550. // Set main layout
  551. if ( is_singular() ) {
  552. global $post;
  553. $layout = get_post_meta($post->ID, 'layout', true);
  554. if ( $layout != '' ) {
  555. global $woo_options;
  556. $woo_options['woo_layout'] = $layout;
  557. }
  558. }
  559. if ( $layout == '' ) {
  560. $layout = get_option( 'woo_layout' );
  561. if ( $layout == '' )
  562. $layout = "two-col-left";
  563. }
  564.  
  565. // Cater for custom portfolio gallery layout option.
  566. if ( is_tax( 'portfolio-gallery' ) || is_post_type_archive( 'portfolio' ) ) {
  567. $portfolio_gallery_layout = get_option( 'woo_portfolio_layout' );
  568.  
  569. if ( $portfolio_gallery_layout != '' ) { $layout = $portfolio_gallery_layout; }
  570. }
  571.  
  572. // Specify site width
  573. $width = get_option( 'woo_layout_width' );
  574. if ( $width == '760px' )
  575. $width = "-760";
  576. elseif ( $width == '960px' )
  577. $width = "-960";
  578. elseif ( $width == '880px' )
  579. $width = "-880";
  580. elseif ( $width == '980px' )
  581. $width = "-980";
  582. elseif ( $width == '1200px' )
  583. $width = "-1200";
  584. else
  585. $width = "-940";
  586.  
  587. // Add classes to body_class() output
  588. $classes[] = $layout;
  589. $classes[] = 'width' . $width;
  590. $classes[] = $layout . $width;
  591. return $classes;
  592. }
  593. }
  594.  
  595. /*-----------------------------------------------------------------------------------*/
  596. /* Woo Slider Setup */
  597. /*-----------------------------------------------------------------------------------*/
  598. if (!function_exists('woo_slider')) {
  599. function woo_slider( $load_slider_js = false ) {
  600. global $woo_options;
  601.  
  602. $load_slider_js = false;
  603.  
  604. if ( ( is_page_template('template-biz.php') && $woo_options['woo_slider_biz'] == "true" ) ||
  605. ( is_page_template('template-magazine.php') && $woo_options['woo_slider_magazine'] == "true" ) ) { $load_slider_js = true; }
  606.  
  607. // Allow child themes/plugins to load the slider JavaScript when they need it.
  608. $load_slider_js = apply_filters( 'woo_load_slider_js', $load_slider_js );
  609.  
  610. if ( $load_slider_js != false ) {
  611.  
  612. // Default slider settings.
  613. $defaults = array(
  614. 'autoStart' => 0,
  615. 'autoHeight' => 'false',
  616. 'hoverPause' => 'false',
  617. 'containerClick' => 'false',
  618. 'slideSpeed' => 600,
  619. 'canAutoStart' => 'false',
  620. 'next' => 'next',
  621. 'prev' => 'previous',
  622. 'container' => 'slides',
  623. 'generatePagination' => 'false',
  624. 'crossfade' => 'true',
  625. 'fadeSpeed' => 600,
  626. 'effect' => 'slide'
  627. );
  628.  
  629. // Dynamic settings from the "Theme Options" screen.
  630. $args = array();
  631.  
  632. if ( $woo_options['woo_slider_pagination'] == 'true' ) { $args['generatePagination'] = 'true'; }
  633. if ( $woo_options['woo_slider_effect'] != '' ) { $args['effect'] = $woo_options['woo_slider_effect']; }
  634. if ( $woo_options['woo_slider_autoheight'] == 'true' ) { $args['autoHeight'] = 'true'; }
  635. if ( $woo_options['woo_slider_hover'] == 'true' ) { $args['hoverPause'] = 'true'; }
  636. if ( $woo_options['woo_slider_containerclick'] == 'true' ) { $args['containerClick'] = 'true'; }
  637. if ( $woo_options['woo_slider_speed'] == 'true' ) { $args['slideSpeed'] = $woo_options['woo_slider_speed'] * 1000; }
  638. if ( $woo_options['woo_slider_speed'] == 'true' ) { $args['fadeSpeed'] = $woo_options['woo_slider_speed'] * 1000; }
  639. if ( $woo_options['woo_slider_auto'] == 'true' ) {
  640. $args['canAutoStart'] = 'true';
  641. $args['autoStart'] = $woo_options['woo_slider_interval'] * 1000;
  642. }
  643.  
  644. // Merge the arguments with defaults.
  645. $args = wp_parse_args( $args, $defaults );
  646.  
  647. // Allow child themes/plugins to filter these arguments.
  648. $args = apply_filters( 'woo_slider_args', $args );
  649.  
  650. ?>
  651. <!-- Woo Slider Setup -->
  652. <script type="text/javascript">
  653. jQuery(window).load(function(){
  654. jQuery( '#loopedSlider' ).slides({
  655. preload: true,
  656. preloadImage: '<?php echo get_template_directory_uri(); ?>/images/loading.png',
  657. play: <?php echo $args['autoStart']; ?>,
  658. <?php if ( $args['effect'] == 'fade' ) { ?>
  659. fadeSpeed: <?php echo $args['fadeSpeed']; ?>,
  660. <?php } else { ?>
  661. slideSpeed: <?php echo $args['slideSpeed']; ?>,
  662. <?php } ?>
  663. autoHeight: <?php echo $args['autoHeight']; ?>,
  664. hoverPause: <?php echo $args['hoverPause']; ?>,
  665. bigTarget: <?php echo $args['containerClick']; ?>,
  666. next: '<?php echo $args['next']; ?>',
  667. prev: '<?php echo $args['prev']; ?>',
  668. container: '<?php echo $args['container']; ?>',
  669. effect: '<?php echo $args['effect']; ?>',
  670. crossfade: true,
  671. randonmize: true,
  672. generatePagination: <?php echo $args['generatePagination']; ?>
  673. });
  674.  
  675. jQuery( '#loopedSlider .pagination' ).wrap( '<div class="pagination-wrap" />' );
  676. });
  677. </script>
  678. <?php if ( ( isset( $containerClick ) ) && ( $containerClick == "true" ) ) { ?>
  679. <style type="text/css">#loopedSlider .container { cursor:pointer; }</style>
  680. <?php } ?>
  681. <!-- /Woo Slider Setup -->
  682. <?php
  683. }
  684. }
  685. }
  686.  
  687. /*-----------------------------------------------------------------------------------*/
  688. /* Woo Slider Magazine */
  689. /*-----------------------------------------------------------------------------------*/
  690. if (!function_exists('woo_slider_magazine')) {
  691. function woo_slider_magazine( $args = null ) {
  692.  
  693. global $woo_options, $wp_query;
  694.  
  695. // This is where our output will be added.
  696. $html = '';
  697.  
  698. // Default slider settings.
  699. $defaults = array(
  700. 'id' => 'loopedSlider',
  701. 'echo' => true,
  702. 'excerpt_length' => '15',
  703. 'pagination' => false,
  704. 'width' => '940',
  705. 'height' => '350',
  706. 'order' => 'ASC',
  707. 'posts_per_page' => '5'
  708. );
  709.  
  710. // Setup width of slider and images
  711. $width = "610";
  712.  
  713. $layout = $woo_options['woo_layout'];
  714. if ( !$layout['woo_layout'] )
  715. $layout = get_option( 'woo_layout' );
  716. $layout_width = get_option( 'woo_layout_width' );
  717.  
  718. if ( $layout == "one-col" ) {
  719.  
  720. if ( $layout_width == '980px' ) {
  721. $width = "980";
  722. } elseif ( $layout_width == '960px' ) {
  723. $width = "960";
  724. } elseif ( $layout_width == '880px' ) {
  725. $width = "880";
  726. } elseif ( $layout_width == '760px' ) {
  727. $width = "760";
  728. } elseif ( $layout_width == '1200px' ) {
  729. $width = "1200";
  730. } else {
  731. $width = "940";
  732. }
  733.  
  734. } elseif ( $layout == "two-col-left" || $layout == "two-col-right" || $layout == "two-col-middle" ) {
  735.  
  736. if ( $layout_width == '980px' ) {
  737. $width = "650";
  738. } elseif ( $layout_width == '960px' ) {
  739. $width = "630";
  740. } elseif ( $layout_width == '880px' ) {
  741. $width = "550";
  742. } elseif ( $layout_width == '760px' ) {
  743. $width = "480";
  744. } elseif ( $layout_width == '1200px' ) {
  745. $width = "800";
  746. } else {
  747. $width = "610";
  748. }
  749.  
  750. } elseif ( $layout == "three-col-left" || $layout == "three-col-right" || $layout == "three-col-middle" ) {
  751.  
  752. if ( $layout_width == '980px' ) {
  753. $width = "480";
  754. } elseif ( $layout_width == '960px' ) {
  755. $width = "460";
  756. } elseif ( $layout_width == '880px' ) {
  757. $width = "420";
  758. } elseif ( $layout_width == '760px' ) {
  759. $width = "350";
  760. } elseif ( $layout_width == '1200px' ) {
  761. $width = "680";
  762. } else {
  763. $width = "440";
  764. }
  765.  
  766. }
  767.  
  768. // Setup slider tags array
  769. $slider_tags = explode(',',$woo_options['woo_slider_magazine_tags']); // Tags to be shown
  770. foreach ($slider_tags as $tags){
  771. $tag = get_term_by( 'name', trim($tags), 'post_tag', 'ARRAY_A' );
  772. if ( $tag['term_id'] > 0 )
  773. $tag_array[] = $tag['term_id'];
  774. }
  775. if ( empty($tag_array) ) {
  776. echo '<p class="note">Please setup Featured Slider Tag(s) in your options panel. You must setup tags that are used on active posts.</p>';
  777. return;
  778. }
  779.  
  780. // Setup the slider CSS class.
  781. $slider_css = '';
  782.  
  783. if ( @$woo_options['woo_slider_pagination'] == 'true' ) {
  784. $slider_css = ' class="has-pagination"';
  785. }
  786.  
  787. // Setup height of slider.
  788. $height = $woo_options['woo_slider_magazine_height'];
  789. if ( $height != '' ) { $defaults['height'] = $height; }
  790.  
  791. // Setup width of slider and images.
  792. $layout = get_option('woo_layout');
  793. $layout_width = get_option('woo_layout_width');
  794.  
  795. // Setup the number of posts to show.
  796. $posts_per_page = $woo_options['woo_slider_magazine_entries'];
  797. if ( $posts_per_page != '' ) { $defaults['posts_per_page'] = $posts_per_page; }
  798.  
  799. // Setup the excerpt length.
  800. $excerpt_length = $woo_options['woo_slider_magazine_excerpt_length'];
  801. if ( $excerpt_length != '' ) { $defaults['excerpt_length'] = $excerpt_length; }
  802.  
  803. //$width = intval( $layout_width );
  804.  
  805. if ( $width > 0 && $args['width'] == '' ) { $defaults['width'] = $width; }
  806.  
  807. // Merge the arguments with defaults.
  808. $args = wp_parse_args( $args, $defaults );
  809.  
  810. // Get layout manager information.
  811. if ( get_option( 'woo_layout_manager_enable' ) == "true" ) {
  812. $layout_info = Woo_Layout::get_layout_info();
  813. $woo_layouts = get_option( 'woo_layout_stored_layouts' );
  814.  
  815. if ( is_array( $layout_info ) && array_key_exists( 'width_main', $layout_info ) && @$woo_options['woo_layout'] != "one-col" ) {
  816. $args['width'] = $layout_info['gutter'] + $layout_info['width_main'] + $layout_info['gutter'];
  817. }
  818. }
  819.  
  820. if ( ( ( isset($args['width']) ) && ( ( $args['width'] <= 0 ) || ( $args['width'] == '') ) ) || ( !isset($args['width']) ) ) { $args['width'] = '100'; }
  821. if ( ( isset($args['height']) ) && ( $args['height'] <= 0 ) ) { $args['height'] = '100'; }
  822.  
  823. // Allow child themes/plugins to filter these arguments.
  824. $args = apply_filters( 'woo_magazine_slider_args', $args );
  825.  
  826. // Begin setting up HTML output.
  827.  
  828. if ( @$woo_options['woo_slider_autoheight'] != 'true' ) {
  829. $html .= '<div id="' . $args['id'] . '"' . $slider_css . ' style="height:' . $args['height'] . 'px">' . "\n";
  830. $html .= '<div class="container" style="height:' . $args['height'] . 'px">' . "\n";
  831. } else {
  832. $html .= '<div id="' . $args['id'] . '"' . $slider_css . ' style="height:auto;">' . "\n";
  833. $html .= '<div class="container" style="height:auto;">' . "\n";
  834. }
  835.  
  836. $saved = $wp_query; query_posts(array('tag__in' => $tag_array, 'showposts' => $args['posts_per_page']));
  837.  
  838. if ( have_posts() ) : $count = 0;
  839.  
  840. if ( @$woo_options['woo_slider_autoheight'] != 'true' )
  841. $html .= '<div class="slides" style="height:' . $args['height'] . 'px">' . "\n";
  842. else
  843. $html .= '<div class="slides">' . "\n";
  844.  
  845. while (have_posts()) : the_post(); global $post; $shownposts[$count] = $post->ID; $count++;
  846.  
  847. $styles = 'width: ' . $args['width'] . 'px;';
  848. if ( $count >= 2 ) { $styles .= ' display:none;'; }
  849.  
  850. $url = get_permalink( $post->ID );
  851.  
  852. $html .= '<div id="slide-' . $count . '" class="slide" style="' . $styles . '">' . "\n";
  853. $html .= '<a href="' . $url . '" title="' . the_title_attribute( array( 'echo' => 0 ) ) . '">' . woo_image('width=' . $args['width'] . '&height=' . $args['height'] . '&link=img&return=true') . '</a>' . "\n";
  854. $html .= '<div class="content">' . "\n";
  855. if ( $woo_options['woo_slider_magazine_title'] == 'true' ) {
  856. $html .= '<h2 class="title"><a href="' . $url . '" title="' . the_title_attribute( array( 'echo' => 0 ) ) . '">' . get_the_title( $post->ID ) . '</a></h2>'; }
  857.  
  858. if ( $woo_options['woo_slider_magazine_excerpt'] == 'true' ) {
  859. $html .= '<div class="excerpt"><p>' . woo_text_trim( get_the_excerpt(), $excerpt_length ) . '</p></div>' . "\n";
  860. }
  861.  
  862. $html .= '</div>' . "\n";
  863.  
  864. $html .= '</div>' . "\n";
  865.  
  866. endwhile; $wp_query = $saved;
  867.  
  868. endif; $wp_query = $saved;
  869.  
  870. $html .= '</div><!-- /.slides -->' . "\n";
  871. $html .= '</div><!-- /.container --> ' . "\n";
  872.  
  873. $html .= '<a href="#" class="previous"><img src="' . get_template_directory_uri() . '/images/btn-prev-slider.png" alt="<" /></a>' . "\n";
  874. $html .= '<a href="#" class="next"><img src="' . get_template_directory_uri() . '/images/btn-next-slider.png" alt=">" /></a>' . "\n";
  875.  
  876.  
  877. $html .= '</div><!-- /#' . $args['id'] . ' -->' . "\n";
  878.  
  879. if ( get_option( 'woo_exclude' ) != $shownposts ) { update_option( "woo_exclude", $shownposts ); }
  880.  
  881. if ( $args['echo'] ) {
  882. echo $html;
  883. }
  884.  
  885. return $html;
  886.  
  887. } // End woo_slider_magazine()
  888. }
  889.  
  890. /*-----------------------------------------------------------------------------------*/
  891. /* Woo Slider Business */
  892. /*-----------------------------------------------------------------------------------*/
  893. if ( ! function_exists( 'woo_slider_biz' ) ) {
  894. function woo_slider_biz( $args = null ) {
  895.  
  896. global $woo_options, $post;
  897.  
  898. // This is where our output will be added.
  899. $html = '';
  900.  
  901. // Default slider settings.
  902. $defaults = array(
  903. 'id' => 'loopedSlider',
  904. 'echo' => true,
  905. 'excerpt_length' => '15',
  906. 'pagination' => false,
  907. 'width' => '940',
  908. 'height' => '350',
  909. 'order' => 'ASC',
  910. 'posts_per_page' => '5',
  911. 'slide_page' => 'all',
  912. 'use_slide_page' => false
  913. );
  914.  
  915. // Setup the "Slide Page", if one is set.
  916. if ( isset( $post->ID ) ) {
  917. $slide_page = 'all';
  918. $stored_slide_page = get_post_meta( $post->ID, '_slide-page', true );
  919.  
  920. if ( $stored_slide_page != '' && $stored_slide_page != 'all' ) {
  921. $slide_page = $stored_slide_page;
  922. $defaults['use_slide_page'] = true; // Instruct the slider to apply the necessary conditional.
  923. $defaults['slide_page'] = $slide_page;
  924. }
  925. }
  926.  
  927. // Setup height of slider.
  928. $height = $woo_options['woo_slider_biz_height'];
  929. if ( $height != '' ) { $defaults['height'] = $height; }
  930.  
  931. // Setup width of slider and images.
  932. $layout = $woo_options['woo_layout'];
  933. if ( !$layout )
  934. $layout = get_option( 'woo_layout' );
  935. $layout_width = get_option('woo_layout_width');
  936.  
  937. // Setup the number of posts to show.
  938. $posts_per_page = $woo_options['woo_slider_biz_number'];
  939. if ( $posts_per_page != '' ) { $defaults['posts_per_page'] = $posts_per_page; }
  940.  
  941. // Setup the order of posts.
  942. $post_order = $woo_options['woo_slider_biz_order'];
  943. if ( $post_order != '' ) { $defaults['order'] = $post_order; }
  944.  
  945. // Setup the excerpt length.
  946. if ( isset($woo_options['woo_slider_biz_excerpt_length']) ) {
  947. $excerpt_length = $woo_options['woo_slider_biz_excerpt_length'];
  948. if ( $excerpt_length != '' ) { $defaults['excerpt_length'] = $excerpt_length; }
  949. }
  950.  
  951. $width = intval( $layout_width );
  952.  
  953. if ( $width > 0 && $args['width'] == '' ) { $defaults['width'] = $width; }
  954.  
  955. // Merge the arguments with defaults.
  956. $args = wp_parse_args( $args, $defaults );
  957.  
  958. if ( ( ( isset($args['width']) ) && ( ( $args['width'] <= 0 ) || ( $args['width'] == '') ) ) || ( !isset($args['width']) ) ) { $args['width'] = '100'; }
  959. if ( ( isset($args['height']) ) && ( $args['height'] <= 0 ) ) { $args['height'] = '100'; }
  960.  
  961. // Allow child themes/plugins to filter these arguments.
  962. $args = apply_filters( 'woo_biz_slider_args', $args );
  963.  
  964. // Setup slider page id's
  965. $query_args = array(
  966. 'post_type' => 'slide',
  967. 'order' => $args['order'],
  968. 'orderby' => 'date',
  969. 'posts_per_page' => $args['posts_per_page']
  970. );
  971.  
  972. if ( $args['use_slide_page'] == true ) {
  973.  
  974. $query_args['tax_query'] = array( array(
  975. 'taxonomy' => 'slide-page',
  976. 'field' => 'slug',
  977. 'terms' => $args['slide_page']
  978. ) );
  979.  
  980. }
  981.  
  982. $slide_query = new WP_Query( $query_args );
  983.  
  984. if ( ( ! $slide_query->have_posts() ) ) {
  985. echo '<p class="note">' . __( 'Please add some slider posts using the Slide custom post type.', 'woothemes' ) . '</p>';
  986. return;
  987. }
  988.  
  989. if ( ( $slide_query->found_posts <= 1 ) ) {
  990. echo '<p class="note">' . __( 'Please note that this slider requires 2 or more slides in order to function. Please assign another slide.', 'woothemes' ) . '</p>';
  991. return;
  992. }
  993.  
  994. // Setup the slider CSS class.
  995. $slider_css = '';
  996.  
  997. if ( @$woo_options['woo_slider_pagination'] == 'true' ) {
  998. $slider_css = ' class="has-pagination"';
  999. }
  1000.  
  1001. // Begin setting up HTML output.
  1002.  
  1003. if ( @$woo_options['woo_slider_autoheight'] != 'true' ) {
  1004. $html .= '<div id="' . $args['id'] . '"' . $slider_css . ' style="height:' . $args['height'] . 'px">' . "\n";
  1005. $html .= '<div class="container" style="height:' . $args['height'] . 'px">' . "\n";
  1006. } else {
  1007. $html .= '<div id="' . $args['id'] . '"' . $slider_css . ' style="height:auto;">' . "\n";
  1008. $html .= '<div class="container" style="height:auto;">' . "\n";
  1009. }
  1010.  
  1011.  
  1012. if ( @$woo_options['woo_slider_autoheight'] != 'true' )
  1013. $html .= '<div class="slides" style="height:' . $args['height'] . 'px">' . "\n";
  1014. else
  1015. $html .= '<div class="slides">' . "\n";
  1016.  
  1017. if ( $slide_query->have_posts() ) { $count = 0; while ( $slide_query->have_posts() ) { $slide_query->the_post(); global $post; $count++;
  1018.  
  1019. $styles = 'width: ' . $args['width'] . 'px;';
  1020. if ( $count >= 2 ) { $styles .= ' display:none;'; }
  1021.  
  1022. $html .= '<div id="slide-' . $count . '" class="slide" style="' . $styles . '">' . "\n";
  1023.  
  1024. $type = get_post_meta( $post->ID, 'image', true );
  1025.  
  1026. if ( $type ) {
  1027. $url = get_post_meta( $post->ID, 'url', true );
  1028.  
  1029. if ( $url ) {
  1030. $html .= '<a href="' . $url . '" title="' . the_title_attribute( array( 'echo' => 0 ) ) . '">' . woo_image('width=' . $args['width'] . '&height=' . $args['height'] . '&link=img&return=true') . '</a>' . "\n";
  1031. } else {
  1032. $html .= woo_image( 'width=' . $args['width'] . '&height=' . $args['height'] . '&link=img&return=true' );
  1033. }
  1034.  
  1035. $html .= '<div class="content">' . "\n";
  1036.  
  1037. if ( $woo_options['woo_slider_biz_title'] == 'true' ) {
  1038. if ( $url ) {} else { $url = get_permalink( $post->ID ); }
  1039.  
  1040. $html .= '<div class="title"><h2 class="title"><a href="' . $url . '">' . get_the_title( $post->ID ) . '</a></h2></div>' . "\n";
  1041. }
  1042. $content = get_the_content($post->ID);
  1043. $content = do_shortcode($content);
  1044.  
  1045. $html .= '<div class="excerpt">' . wpautop( $content ) . '</div>' . "\n";
  1046. $html .= '</div>' . "\n";
  1047.  
  1048. } else {
  1049.  
  1050. $content = get_the_content($post->ID);
  1051. $content = do_shortcode($content);
  1052.  
  1053. $html .= '<div class="entry">' . wpautop( $content ) . '</div>' . "\n";
  1054.  
  1055. }
  1056.  
  1057. $html .= '</div>' . "\n";
  1058.  
  1059. } // End WHILE Loop
  1060.  
  1061. } // End IF Statement
  1062.  
  1063. $html .= '</div><!-- /.slides -->' . "\n";
  1064. $html .= '</div><!-- /.container --> ' . "\n";
  1065.  
  1066. $html .= '<a href="#" class="previous"><img src="' . get_template_directory_uri() . '/images/btn-prev-slider.png" alt="<" /></a>' . "\n";
  1067. $html .= '<a href="#" class="next"><img src="' . get_template_directory_uri() . '/images/btn-next-slider.png" alt=">" /></a>' . "\n";
  1068.  
  1069.  
  1070. $html .= '</div><!-- /#' . $args['id'] . ' -->' . "\n";
  1071.  
  1072. if ( $args['echo'] ) {
  1073. echo $html;
  1074. }
  1075.  
  1076. return $html;
  1077.  
  1078. } // End woo_slider_biz()
  1079. }
  1080.  
  1081. /*-----------------------------------------------------------------------------------*/
  1082. /* Navigation */
  1083. /*-----------------------------------------------------------------------------------*/
  1084. if ( ! function_exists( 'woo_nav' ) ) {
  1085. function woo_nav() {
  1086. global $woo_options;
  1087. woo_nav_before();
  1088. ?>
  1089. <div id="navigation" class="col-full">
  1090. <?php woo_nav_inside(); ?>
  1091. <?php
  1092. if ( function_exists( 'has_nav_menu' ) && has_nav_menu( 'primary-menu' ) ) {
  1093. wp_nav_menu( array( 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'main-nav', 'menu_class' => 'nav fl', 'theme_location' => 'primary-menu' ) );
  1094. } else {
  1095. ?>
  1096. <ul id="main-nav" class="nav fl">
  1097. <?php
  1098. if ( get_option( 'woo_custom_nav_menu' ) == 'true' ) {
  1099. if ( function_exists( 'woo_custom_navigation_output' ) )
  1100. woo_custom_navigation_output( "name=Woo Menu 1" );
  1101.  
  1102. } else { ?>
  1103.  
  1104. <?php if ( is_page() ) $highlight = "page_item"; else $highlight = "page_item current_page_item"; ?>
  1105. <li class="<?php echo $highlight; ?>"><a href="<?php echo home_url( '/' ); ?>"><?php _e( 'Home', 'woothemes' ); ?></a></li>
  1106. <?php wp_list_pages( 'sort_column=menu_order&depth=6&title_li=&exclude=' ); ?>
  1107. <?php } ?>
  1108. </ul><!-- /#nav -->
  1109. <?php } ?>
  1110. </div><!-- /#navigation -->
  1111. <?php
  1112. woo_nav_after();
  1113. } // End woo_nav()
  1114. }
  1115.  
  1116. /*-----------------------------------------------------------------------------------*/
  1117. /* Add subscription links to the navigation bar */
  1118. /*-----------------------------------------------------------------------------------*/
  1119.  
  1120. if ( ! function_exists( 'woo_nav_subscribe' ) ) {
  1121. function woo_nav_subscribe() {
  1122. global $woo_options;
  1123.  
  1124. if ( ( isset( $woo_options['woo_nav_rss'] ) ) && ( $woo_options['woo_nav_rss'] == 'true' ) ) { ?>
  1125. <ul class="rss fr">
  1126. <?php if ( ( isset( $woo_options['woo_subscribe_email'] ) ) && ( $woo_options['woo_subscribe_email'] ) ) { ?>
  1127. <li class="sub-email"><a href="<?php echo $woo_options['woo_subscribe_email'] ?>" target="_blank"><?php _e( 'Subscribe by Email', 'woothemes' ); ?></a></li>
  1128. <?php } ?>
  1129. <li class="sub-rss"><a href="<?php if ( $woo_options['woo_feed_url'] ) { echo $woo_options['woo_feed_url']; } else { echo get_bloginfo_rss( 'rss2_url' ); } ?>"><?php _e( 'Subscribe to RSS', 'woothemes' ); ?></a></li>
  1130. </ul>
  1131. <?php }
  1132. } // End woo_nav_subscribe()
  1133. }
  1134.  
  1135. /*-----------------------------------------------------------------------------------*/
  1136. /* Post More */
  1137. /*-----------------------------------------------------------------------------------*/
  1138.  
  1139. if ( ! function_exists( 'woo_post_more' ) ) {
  1140. function woo_post_more() {
  1141.  
  1142. if ( get_option( 'woo_disable_post_more' ) != 'true' ) {
  1143.  
  1144. $html = '';
  1145.  
  1146. if ( get_option('woo_post_content') == 'excerpt' ) { $html .= '[view_full_article after=" <span class=\'sep\'>&bull;</span>"] '; }
  1147. $html .= '[post_comments]';
  1148.  
  1149. $html = apply_filters( 'woo_post_more', $html );
  1150.  
  1151. if ( $html != '' ) {
  1152. ?>
  1153. <div class="post-more">
  1154. <?php
  1155. echo $html;
  1156. ?>
  1157. </div>
  1158. <?php
  1159. }
  1160. }
  1161. } // End woo_post_more()
  1162. }
  1163.  
  1164. /*-----------------------------------------------------------------------------------*/
  1165. /* Video Embed */
  1166. /*-----------------------------------------------------------------------------------*/
  1167. if ( ! function_exists( 'canvas_get_embed' ) ) {
  1168. function canvas_get_embed() {
  1169. global $woo_options;
  1170.  
  1171. // Setup height & width of embed
  1172. $width = "610";
  1173. $height = "343";
  1174. $layout = $woo_options['woo_layout'];
  1175. $layout_width = get_option( 'woo_layout_width' );
  1176.  
  1177. if ( $layout == "one-col" ) {
  1178.  
  1179. if ( $layout_width == '980px' ) {
  1180. $width = "980";
  1181. $height = '613';
  1182. } elseif ( $layout_width == '960px' ) {
  1183. $width = "960";
  1184. $height = '600';
  1185. } elseif ( $layout_width == '880px' ) {
  1186. $width = "880";
  1187. $height = '550';
  1188. } elseif ( $layout_width == '760px' ) {
  1189. $width = "760";
  1190. $height = '475';
  1191. } elseif ( $layout_width == '1200px' ) {
  1192. $width = "1200";
  1193. $height = '750';
  1194. } else {
  1195. $width = "940";
  1196. $height = '588';
  1197. }
  1198.  
  1199. } elseif ( $layout == "two-col-left" || $layout == "two-col-right" || $layout == "two-col-middle" ) {
  1200.  
  1201. if ( $layout_width == '980px' ) {
  1202. $width = "650";
  1203. $height = "365";
  1204. } elseif ( $layout_width == '960px' ) {
  1205. $width = "630";
  1206. $height = "354";
  1207. } elseif ( $layout_width == '880px' ) {
  1208. $width = "550";
  1209. $height = "309";
  1210. } elseif ( $layout_width == '760px' ) {
  1211. $width = "480";
  1212. $height = "270";
  1213. } elseif ( $layout_width == '1200px' ) {
  1214. $width = "800";
  1215. $height = "450";
  1216. } else {
  1217. $width = "610";
  1218. }
  1219.  
  1220. } elseif ( $layout == "three-col-left" || $layout == "three-col-right" || $layout == "three-col-middle" ) {
  1221.  
  1222. if ( $layout_width == '980px' ) {
  1223. $width = "480";
  1224. $height = "270";
  1225. } elseif ( $layout_width == '960px' ) {
  1226. $width = "460";
  1227. $height = "259";
  1228. } elseif ( $layout_width == '880px' ) {
  1229. $width = "420";
  1230. $height = "236";
  1231. } elseif ( $layout_width == '760px' ) {
  1232. $width = "350";
  1233. $height = "197";
  1234. } elseif ( $layout_width == '1200px' ) {
  1235. $width = "680";
  1236. $height = "380";
  1237. } else {
  1238. $width = "440";
  1239. $height = "247";
  1240. }
  1241.  
  1242. }
  1243.  
  1244. $embed = woo_embed( 'width=' . $width . '&height=' . $height );
  1245.  
  1246. if ( $embed != '' ) {
  1247. ?>
  1248.  
  1249. <div class="post-embed">
  1250. <?php echo $embed; ?>
  1251. </div><!-- /.post-embed -->
  1252.  
  1253. <?php
  1254. }
  1255. }
  1256. }
  1257.  
  1258.  
  1259. /*-----------------------------------------------------------------------------------*/
  1260. /* Author Box */
  1261. /*-----------------------------------------------------------------------------------*/
  1262. if ( ! function_exists( 'woo_author' ) ) {
  1263. function woo_author() {
  1264.  
  1265. // Author box single post page
  1266. if ( is_single() && get_option( 'woo_disable_post_author' ) != 'true' )
  1267. add_action( 'woo_post_inside_after', 'woo_author_box', 10 );
  1268.  
  1269. // Author box author page
  1270. elseif ( is_author() )
  1271. add_action( 'woo_loop_before', 'woo_author_box', 10 );
  1272.  
  1273. }
  1274. }
  1275.  
  1276.  
  1277. /*-----------------------------------------------------------------------------------*/
  1278. /* Single Post Author */
  1279. /*-----------------------------------------------------------------------------------*/
  1280. if ( ! function_exists( 'woo_author_box' ) ) {
  1281. function woo_author_box() {
  1282. global $post;
  1283. $author_id=$post->post_author;
  1284. ?>
  1285. <div id="post-author">
  1286. <div class="profile-image"><?php echo get_avatar( $author_id, '80' ); ?></div>
  1287. <div class="profile-content">
  1288. <h4><?php printf( esc_attr__( 'About %s', 'woothemes' ), get_the_author_meta( 'display_name', $author_id ) ); ?></h4>
  1289. <?php echo get_the_author_meta( 'description', $author_id ); ?>
  1290. <?php if (is_singular()) : ?>
  1291. <div class="profile-link">
  1292. <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID', $author_id ) ); ?>">
  1293. <?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'woothemes' ), get_the_author_meta( 'display_name', $author_id ) ); ?>
  1294. </a>
  1295. </div><!-- #profile-link -->
  1296. <?php endif; ?>
  1297. </div>
  1298. <div class="fix"></div>
  1299. </div>
  1300. <?php
  1301. }
  1302. }
  1303.  
  1304.  
  1305. /*-----------------------------------------------------------------------------------*/
  1306. /* Yoast Breadcrumbs */
  1307. /*-----------------------------------------------------------------------------------*/
  1308. if (!function_exists('_dep_woo_breadcrumbs') ) {
  1309. function _dep_woo_breadcrumbs() {
  1310. if ( function_exists('yoast_breadcrumb') ) {
  1311. yoast_breadcrumb('<div id="breadcrumb"><p>','</p></div>');
  1312. }
  1313. }
  1314. }
  1315.  
  1316.  
  1317. /*-----------------------------------------------------------------------------------*/
  1318. /* Subscribe & Connect */
  1319. /*-----------------------------------------------------------------------------------*/
  1320. if ( ! function_exists( 'woo_subscribe_connect_action' ) ) {
  1321. function woo_subscribe_connect_action() {
  1322.  
  1323. // single post page
  1324. if ( is_single() && get_option('woo_connect') == "true" )
  1325. add_action('woo_post_inside_after', 'woo_subscribe_connect');
  1326.  
  1327. }
  1328. }
  1329.  
  1330.  
  1331. /*-----------------------------------------------------------------------------------*/
  1332. /* Optional Top Navigation (WP Menus) */
  1333. /*-----------------------------------------------------------------------------------*/
  1334. if ( ! function_exists( 'woo_top_navigation' ) ) {
  1335. function woo_top_navigation() {
  1336.  
  1337. if ( function_exists('has_nav_menu') && has_nav_menu('top-menu') ) { ?>
  1338.  
  1339. <div id="top">
  1340. <div class="col-full">
  1341. <?php wp_nav_menu( array( 'depth' => 6, 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'top-nav', 'menu_class' => 'nav fl', 'theme_location' => 'top-menu' ) ); ?>
  1342. </div>
  1343. </div><!-- /#top -->
  1344.  
  1345. <?php
  1346. }
  1347. }
  1348. }
  1349.  
  1350. /*-----------------------------------------------------------------------------------*/
  1351. /* Footer Widgetized Areas */
  1352. /*-----------------------------------------------------------------------------------*/
  1353.  
  1354. add_action( 'woo_footer_top', 'woo_footer_sidebars', 10 );
  1355.  
  1356. if ( ! function_exists( 'woo_footer_sidebars' ) ) {
  1357. function woo_footer_sidebars() {
  1358. global $woo_options;
  1359.  
  1360. $footer_sidebar_total = 4;
  1361. $has_footer_sidebars = false;
  1362.  
  1363. // Check if we have footer sidebars to display.
  1364. for ( $i = 1; $i <= $footer_sidebar_total; $i++ ) {
  1365. if ( woo_active_sidebar( 'footer-' . $i ) && ( $has_footer_sidebars == false ) ) {
  1366. $has_footer_sidebars = true;
  1367. }
  1368. }
  1369.  
  1370. // If footer sidebars are available, we're on the "Business" page template and we want to disable them, do so.
  1371. if ( $has_footer_sidebars && is_page_template( 'template-biz.php' ) && ( @$woo_options['woo_biz_disable_footer_widgets'] == 'true' ) ) {
  1372. $has_footer_sidebars = false;
  1373. }
  1374.  
  1375. // Lastly, we display the sidebars.
  1376. if ( $has_footer_sidebars ) {
  1377.  
  1378. $total = $woo_options['woo_footer_sidebars']; if ( ! $total ) { $total = $footer_sidebar_total; }
  1379.  
  1380. ?>
  1381. <div id="footer-widgets" class="col-full col-<?php echo $total; ?>">
  1382.  
  1383. <?php $i = 0; while ( $i < $total ) { $i++; ?>
  1384. <?php if ( woo_active_sidebar( 'footer-' . $i ) ) { ?>
  1385. <div class="block footer-widget-<?php echo $i; ?>">
  1386. <?php woo_sidebar( 'footer-' . $i ); ?>
  1387. </div>
  1388. <?php } ?>
  1389. <?php } // End WHILE Loop ?>
  1390.  
  1391. <div class="fix"></div>
  1392.  
  1393. </div><!--/#footer-widgets-->
  1394. <?php
  1395.  
  1396. } // End IF Statement
  1397.  
  1398. } // End woo_footer_sidebars()
  1399. }
  1400.  
  1401. /*-----------------------------------------------------------------------------------*/
  1402. /* Add customisable footer areas */
  1403. /*-----------------------------------------------------------------------------------*/
  1404.  
  1405. /**
  1406. * Add customisable footer areas.
  1407. *
  1408. * @package WooFramework
  1409. * @subpackage Actions
  1410. */
  1411.  
  1412. if ( ! function_exists( 'woo_footer_left' ) ) {
  1413. function woo_footer_left () {
  1414.  
  1415. global $woo_options;
  1416.  
  1417. woo_do_atomic( 'woo_footer_left_before' );
  1418.  
  1419. $html = '';
  1420.  
  1421. if( $woo_options['woo_footer_left'] == 'true' ) {
  1422. $html .= '<p>'.stripslashes( $woo_options['woo_footer_left_text'] ).'</p>';
  1423. } else {
  1424. $html .= '[site_copyright]';
  1425. } // End IF Statement
  1426.  
  1427. $html = apply_filters( 'woo_footer_left', $html );
  1428.  
  1429. echo $html;
  1430.  
  1431. woo_do_atomic( 'woo_footer_left_after' );
  1432.  
  1433. } // End woo_footer_left()
  1434. }
  1435.  
  1436. if ( ! function_exists( 'woo_footer_right' ) ) {
  1437. function woo_footer_right () {
  1438.  
  1439. global $woo_options;
  1440.  
  1441. woo_do_atomic( 'woo_footer_right_before' );
  1442.  
  1443. $html = '';
  1444.  
  1445. if( $woo_options['woo_footer_right'] == 'true' ) {
  1446. $html .= '<p>'.stripslashes( $woo_options['woo_footer_right_text'] ).'</p>';
  1447. } else {
  1448. $html .= '[site_credit]';
  1449. } // End IF Statement
  1450.  
  1451. $html = apply_filters( 'woo_footer_right', $html );
  1452.  
  1453. echo $html;
  1454.  
  1455. woo_do_atomic( 'woo_footer_right_after' );
  1456.  
  1457. } // End woo_footer_right()
  1458. }
  1459.  
  1460. /*-----------------------------------------------------------------------------------*/
  1461. /* Add customisable post meta */
  1462. /*-----------------------------------------------------------------------------------*/
  1463.  
  1464. /**
  1465. * Add customisable post meta.
  1466. *
  1467. * Add customisable post meta, using shortcodes,
  1468. * to be added/modified where necessary.
  1469. *
  1470. * @package WooFramework
  1471. * @subpackage Actions
  1472. */
  1473.  
  1474. if ( ! function_exists( 'woo_post_meta' ) ) {
  1475. function woo_post_meta() {
  1476.  
  1477. if ( is_page() ) { return; }
  1478.  
  1479. $post_info = '<span class="small">' . __( 'By', 'woothemes' ) . '</span> [post_author_posts_link] <span class="small">' . __( 'on', 'woothemes' ) . '</span> [post_date] <span class="small">' . __( 'in', 'woothemes' ) . '</span> [post_categories before=""] ' . ' [post_edit]';
  1480. printf( '<div class="post-meta">%s</div>' . "\n", apply_filters( 'woo_filter_post_meta', $post_info ) );
  1481.  
  1482. } // End woo_post_meta()
  1483. }
  1484.  
  1485. /*-----------------------------------------------------------------------------------*/
  1486. /* Add Post Thumbnail to Single posts on Archives */
  1487. /*-----------------------------------------------------------------------------------*/
  1488.  
  1489. /**
  1490. * Add Post Thumbnail to Single posts on Archives
  1491. *
  1492. * Add code to the woo_post_inside_before() hook.
  1493. *
  1494. * @package WooFramework
  1495. * @subpackage Actions
  1496. */
  1497.  
  1498. add_action( 'woo_post_inside_before', 'woo_display_post_image', 10 );
  1499.  
  1500. if ( ! function_exists( 'woo_display_post_image' ) ) {
  1501. function woo_display_post_image() {
  1502.  
  1503. global $woo_options;
  1504.  
  1505. $display_image = false;
  1506.  
  1507. $width = $woo_options['woo_thumb_w'];
  1508. $height = $woo_options['woo_thumb_h'];
  1509. $align = $woo_options['woo_thumb_align'];
  1510.  
  1511. if ( is_single() && @$woo_options['woo_thumb_single'] == 'true' ) {
  1512. $width = $woo_options['woo_single_w'];
  1513. $height = $woo_options['woo_single_h'];
  1514. $align = $woo_options['woo_thumb_align_single'];
  1515. $display_image = true;
  1516. }
  1517.  
  1518. if ( get_option('woo_woo_tumblog_switch') == 'true' ) { $is_tumblog = woo_tumblog_test(); } else { $is_tumblog = false; }
  1519.  
  1520. if ( $is_tumblog || ( is_single() && @$woo_options['woo_thumb_single'] == 'false' ) ) { $display_image = false; }
  1521.  
  1522. if ( $display_image == true and !woo_embed('') ) { woo_image('width=' . $width . '&height=' . $height . '&class=thumbnail ' . $align); }
  1523.  
  1524. } // End woo_display_post_image()
  1525. }
  1526.  
  1527. /*-----------------------------------------------------------------------------------*/
  1528. /* Post Inside After */
  1529. /*-----------------------------------------------------------------------------------*/
  1530. /**
  1531. * Post Inside After
  1532. *
  1533. * Add code to the woo_post_inside_after() hook.
  1534. *
  1535. * @package WooFramework
  1536. * @subpackage Actions
  1537. */
  1538.  
  1539. add_action( 'woo_post_inside_after_singular-post', 'woo_post_inside_after_default', 10 );
  1540.  
  1541. if ( ! function_exists( 'woo_post_inside_after_default' ) ) {
  1542. function woo_post_inside_after_default() {
  1543.  
  1544. $post_info ='[post_tags before=""]';
  1545. printf( '<div class="post-utility">%s</div>' . "\n", apply_filters( 'woo_post_inside_after_default', $post_info ) );
  1546.  
  1547. } // End woo_post_inside_after_default()
  1548. }
  1549.  
  1550. /*-----------------------------------------------------------------------------------*/
  1551. /* Modify the default "comment" form field. */
  1552. /*-----------------------------------------------------------------------------------*/
  1553. /**
  1554. * Modify the default "comment" form field.
  1555. *
  1556. * @package WooFramework
  1557. * @subpackage Filters
  1558. */
  1559.  
  1560. add_filter( 'comment_form_field_comment', 'woo_comment_form_comment', 10 );
  1561.  
  1562. if ( ! function_exists( 'woo_comment_form_comment' ) ) {
  1563. function woo_comment_form_comment ( $field ) {
  1564.  
  1565. $field = str_replace( '<label ', '<label class="hide" ', $field );
  1566. $field = str_replace( 'cols="45"', 'cols="50"', $field );
  1567. $field = str_replace( 'rows="8"', 'rows="10"', $field );
  1568.  
  1569. return $field;
  1570.  
  1571. } // End woo_comment_form_comment()
  1572. }
  1573.  
  1574. /*-----------------------------------------------------------------------------------*/
  1575. /* Add theme default comment form fields. */
  1576. /*-----------------------------------------------------------------------------------*/
  1577. /**
  1578. * Add theme default comment form fields.
  1579. *
  1580. * @package WooFramework
  1581. * @subpackage Filters
  1582. */
  1583.  
  1584. add_filter( 'comment_form_default_fields', 'woo_comment_form_fields', 10 );
  1585.  
  1586. if ( ! function_exists( 'woo_comment_form_fields' ) ) {
  1587. function woo_comment_form_fields ( $fields ) {
  1588.  
  1589. $commenter = wp_get_current_commenter();
  1590.  
  1591. $req = get_option( 'require_name_email' );
  1592. $aria_req = ( $req ? " aria-required='true'" : '' );
  1593.  
  1594. $fields = array(
  1595. 'author' => '<p class="comment-form-author"><input id="author" name="author" type="text" class="txt" tabindex="1" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' />' .
  1596. '<label for="author">' . __( 'Name', 'woothemes' ) . ( $req ? ' <span class="required">(' . __( 'required', 'woothemes' ) . ')</span>' : '' ) . '</label> ' . '</p>',
  1597. 'email' => '<p class="comment-form-email"><input id="email" name="email" type="text" class="txt" tabindex="2" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' />' .
  1598. '<label for="email">' . __( 'Email (will not be published)', 'woothemes' ) . ( $req ? ' <span class="required">(' . __( 'required', 'woothemes' ) . ')</span>' : '' ) . '</label> ' . '</p>',
  1599. 'url' => '<p class="comment-form-url"><input id="url" name="url" type="text" class="txt" tabindex="3" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" />' .
  1600. '<label for="url">' . __( 'Website', 'woothemes' ) . '</label></p>',
  1601. );
  1602.  
  1603. return $fields;
  1604.  
  1605. } // End woo_comment_form_fields()
  1606. }
  1607.  
  1608. /*-----------------------------------------------------------------------------------*/
  1609. /* Add theme default comment form arguments. */
  1610. /*-----------------------------------------------------------------------------------*/
  1611. /**
  1612. * Add theme default comment form arguments.
  1613. *
  1614. * @package WooFramework
  1615. * @subpackage Filters
  1616. */
  1617.  
  1618. add_filter( 'comment_form_defaults', 'woo_comment_form_args', 10 );
  1619.  
  1620. if ( ! function_exists( 'woo_comment_form_args' ) ) {
  1621. function woo_comment_form_args ( $args ) {
  1622.  
  1623. // Add tabindex of "field count + 1" to the comment textarea. This lets us cater for additional fields and have a dynamic tab index.
  1624. $tabindex = count( $args['fields'] ) + 1;
  1625. $args['comment_field'] = str_replace( '<textarea ', '<textarea tabindex="' . $tabindex . '" ', $args['comment_field'] );
  1626.  
  1627. // Adjust tabindex for "submit" button.
  1628. $tabindex++;
  1629.  
  1630. $args['label_submit'] = __( 'Submit Comment', 'woothemes' );
  1631. $args['comment_notes_before'] = '';
  1632. $args['comment_notes_after'] = '';
  1633. $args['cancel_reply_link'] = __( 'Click here to cancel reply.', 'woothemes' );
  1634.  
  1635. return $args;
  1636.  
  1637. } // End woo_comment_form_args()
  1638. }
  1639.  
  1640. /*-----------------------------------------------------------------------------------*/
  1641. /* Activate shortcode compatibility in our new custom areas. */
  1642. /*-----------------------------------------------------------------------------------*/
  1643. /**
  1644. * Activate shortcode compatibility in our new custom areas.
  1645. *
  1646. * @package WooFramework
  1647. * @subpackage Filters
  1648. */
  1649. $sections = array( 'woo_filter_post_meta', 'woo_post_inside_after_default', 'woo_post_more', 'woo_footer_left', 'woo_footer_right' );
  1650.  
  1651. foreach ( $sections as $s ) { add_filter( $s, 'do_shortcode', 20 ); }
  1652.  
  1653. /*-----------------------------------------------------------------------------------*/
  1654. /* woo_content_templates_magazine() */
  1655. /*-----------------------------------------------------------------------------------*/
  1656. /**
  1657. * woo_content_templates_magazine()
  1658. *
  1659. * Remove the tumblog content template from the templates
  1660. * to search through, if on the "Magazine" page template.
  1661. *
  1662. * @package WooFramework
  1663. * @subpackage Filters
  1664. */
  1665.  
  1666. add_filter( 'woo_content_templates', 'woo_content_templates_magazine', 10 );
  1667.  
  1668. if ( ! function_exists( 'woo_content_templates_magazine' ) ) {
  1669. function woo_content_templates_magazine ( $templates ) {
  1670.  
  1671. global $page_template;
  1672.  
  1673. if ( $page_template == 'template-magazine.php' ) {
  1674. foreach ( $templates as $k => $v ) {
  1675. $v = str_replace( '.php', '', $v );
  1676. $bits = explode( '-', $v );
  1677. if ( $bits[1] == 'tumblog' ) {
  1678. unset( $templates[$k] );
  1679. }
  1680. }
  1681. }
  1682.  
  1683. return $templates;
  1684.  
  1685. } // End woo_content_templates_magazine()
  1686. }
  1687.  
  1688. /*-----------------------------------------------------------------------------------*/
  1689. /* woo_feedburner_link() */
  1690. /*-----------------------------------------------------------------------------------*/
  1691. /**
  1692. * woo_feedburner_link()
  1693. *
  1694. * Replace the default RSS feed link with the Feedburner URL, if one
  1695. * has been provided by the user.
  1696. *
  1697. * @package WooFramework
  1698. * @subpackage Filters
  1699. */
  1700.  
  1701. add_filter( 'feed_link', 'woo_feedburner_link', 10 );
  1702.  
  1703. if ( ! function_exists( 'woo_feedburner_link' ) ) {
  1704. function woo_feedburner_link ( $output, $feed = null ) {
  1705.  
  1706. global $woo_options;
  1707.  
  1708. $default = get_default_feed();
  1709.  
  1710. if ( ! $feed ) $feed = $default;
  1711.  
  1712. if ( $woo_options[ 'woo_feed_url' ] && ( $feed == $default ) && ( ! stristr( $output, 'comments' ) ) ) $output = $woo_options[ 'woo_feed_url' ];
  1713.  
  1714. return $output;
  1715.  
  1716. } // End woo_feedburner_link()
  1717. }
  1718.  
  1719.  
  1720. /*-----------------------------------------------------------------------------------*/
  1721. /* END */
  1722. /*-----------------------------------------------------------------------------------*/
  1723. ?>
Add Comment
Please, Sign In to add comment