Advertisement
Guest User

Untitled

a guest
May 13th, 2012
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.47 KB | None | 0 0
  1. <?php
  2. add_custom_background();
  3. add_theme_support('automatic-feed-links');
  4. if ( ! isset( $content_width ) )
  5. $content_width = 630;
  6.  
  7. //Post Thumbnail
  8. if(function_exists('add_theme_support')) {
  9. add_theme_support( 'post-thumbnails' );
  10. }
  11.  
  12. //Register Menus
  13. register_nav_menus( array(
  14. 'primary' => __( 'Primary Navigation', 'zenon' ),
  15. 'footer' => __( 'Footer Navigation', 'zenon' )
  16. ) );
  17.  
  18.  
  19. //Include CSS
  20. function znn_customstyle() { ?>
  21.  
  22. <?php if(of_get_option('prmtrans_checkbox') == "1"){ ?>
  23. <style type="text/css">
  24. #zn_slider, .midrow_blocks, .lay1 .hentry, .lay2, .lay3 .post_image, .lay3 .post_content, .single_post, .commentlist li, #commentform, #commentform label, #sidebar .widgets .widget, #footer, #copyright, .amp_current, .amp_page:hover, .amp_next:hover, .amp_prev:hover, .page-numbers:hover, .navigation .current, #related_wrap ul, .trigger_wrap, .search_term, ol#controls li, .amp_page, .amp_next, .amp_prev, .page-numbers{ background:url(<?php echo get_template_directory_uri(); ?>/images/trans_black4.png) repeat; }
  25. .comment-form-comment textarea, .comment-form-author input, .comment-form-email input, .comment-form-url input{background:url(<?php echo get_template_directory_uri(); ?>/images/trans_black3.png) repeat;}
  26. .lay3_bridge{ display:none;}
  27.  
  28. .skew_bottom_big, .skew_bottom_right, .skew_top_big, .skew_top_right, .single_skew, .single_skew .skew_bottom_big, .single_skew .skew_bottom_right, .depth-1 .single_skew, .single_skew_comm, .single_skew_comm .skew_top_big, .single_skew_comm .skew_top_right, #respond_wrap .single_skew, #respond_wrap .single_skew_comm{display:none!important;}
  29. .commentlist .depth-1{ margin-top:10px;}
  30. .midrow_blocks{ margin-top:30px;}
  31. .commentlist li{border-bottom:1px solid #ececec; border-top:1px solid #ececec;}
  32. </style>
  33. <?php } ?>
  34.  
  35. <?php if(of_get_option('rounded_checkbox') == "1"){ ?>
  36. <style type="text/css">
  37. .skew_bottom_big, .skew_bottom_right, .skew_top_big, .skew_top_right, .single_skew, .single_skew .skew_bottom_big, .single_skew .skew_bottom_right, .depth-1 .single_skew, .single_skew_comm, .single_skew_comm .skew_top_big, .single_skew_comm .skew_top_right, #respond_wrap .single_skew, #respond_wrap .single_skew_comm{display:none!important;}
  38. .commentlist .depth-1{ margin-top:10px;}
  39. .midrow_blocks{ margin-top:30px;}
  40. .commentlist li{border-bottom:1px solid #ececec; border-top:1px solid #ececec;}
  41.  
  42. .home #topmenu{border-radius: 8px 8px 0 0; -moz-border-radius: 8px 8px 0 0; -webkit-border-radius: 8px 8px 0 0;behavior: url(<?php echo get_template_directory_uri(); ?>/images/PIE.htc);}
  43. #zn_slider, #topmenu ul li ul{border-radius: 0 0 8px 8px; -moz-border-radius: 0 0 8px 8px; -webkit-border-radius: 0 0 8px 8px;behavior: url(<?php echo get_template_directory_uri(); ?>/images/PIE.htc);}
  44. #topmenu, .midrow_blocks, #footer, #copyright, .lay1 .hentry, .single_post, #sidebar .widgets .widget, .commentlist .depth-1, #commentform, .comment-form-comment textarea, .form-submit input, #searchsubmit, #related_wrap ul, .znn_paginate span, .znn_paginate a, .navigation a, .navigation span, .lay2, .lay3 .post_image, .lay3 .post_content, .comment-form-author input, .comment-form-email input, .comment-form-url input, .commentlist li ul li .comment-body{border-radius:8px; -moz-border-radius:8px; -webkit-border-radius:8px;behavior: url(<?php echo get_template_directory_uri(); ?>/images/PIE.htc);}
  45. #commentform label{border-radius: 8px 0 0 8px; -moz-border-radius: 8px 0 0 8px; -webkit-border-radius: 8px 0 0 8px;behavior: url(<?php echo get_template_directory_uri(); ?>/images/PIE.htc);}
  46.  
  47. </style>
  48. <?php } ?>
  49.  
  50. <?php if(of_get_option('skewed_checkbox') == "0"){ ?>
  51. <style type="text/css">
  52. .skew_bottom_big, .skew_bottom_right, .skew_top_big, .skew_top_right, .single_skew, .single_skew .skew_bottom_big, .single_skew .skew_bottom_right, .depth-1 .single_skew, .single_skew_comm, .single_skew_comm .skew_top_big, .single_skew_comm .skew_top_right, #respond_wrap .single_skew, #respond_wrap .single_skew_comm{display:none!important;}
  53. .commentlist .depth-1{ margin-top:10px;}
  54. .midrow_blocks{ margin-top:30px;}
  55. .commentlist li{border-bottom:1px solid #ececec; border-top:1px solid #ececec;}
  56. </style>
  57. <?php } else { ?>
  58. <style type="text/css">#zn_slider{ border:none;}</style>
  59. <?php } ?>
  60.  
  61. <?php }
  62.  
  63. add_action( 'wp_head', 'znn_customstyle' );
  64.  
  65.  
  66. //Load Java Scripts to header
  67. function znn_head_js() {
  68. if ( !is_admin() ) {
  69. wp_enqueue_script('jquery');
  70. wp_enqueue_script('znn_js',get_template_directory_uri().'/zenon.js');
  71. wp_enqueue_script('znn_other',get_template_directory_uri().'/js/other.js');
  72. wp_enqueue_script('znn_transform',get_template_directory_uri().'/js/jquery.transform.min.js');
  73. if(of_get_option('slider_select') == "easyslider"){ wp_enqueue_script('znn_easyslider',get_template_directory_uri().'/js/easyslider.js');}
  74. if(of_get_option('disslight_checkbox') == "0"){ wp_enqueue_script('znn_fancybox',get_template_directory_uri().'/js/fancybox.js'); }
  75.  
  76. }
  77. }
  78. add_action('wp_enqueue_scripts', 'znn_head_js');
  79.  
  80. //Load Java Scripts to Footer
  81. add_action('wp_footer', 'znn_load_js');
  82.  
  83. function znn_load_js() { ?>
  84.  
  85. <?php if(of_get_option('slider_select') == "easyslider"){ ?>
  86. <script type="text/javascript">
  87. /* <![CDATA[ */
  88. jQuery(function(){
  89. jQuery("#slider").easySlider({
  90. auto: true,
  91. continuous: true,
  92. numeric: true,
  93. pause: <?php echo of_get_option('sliderspeed_text'); ?>
  94. });
  95. });
  96. /* ]]> */
  97. </script>
  98. <?php } ?>
  99.  
  100. <?php if(of_get_option('stickm_checkbox') == "1"){ ?>
  101. <script type="text/javascript">
  102. /* <![CDATA[ */
  103. //Sticky MENU
  104. jQuery(window).load(function($) {
  105. if (jQuery("body").hasClass('logged-in')) {
  106. jQuery("#topmenu").sticky({topSpacing:27});
  107. }
  108. else {
  109. jQuery("#topmenu").sticky({topSpacing:0});
  110. }
  111. jQuery("#topmenu").css({"z-index":"11"});
  112. });
  113. //JQUERY Site title Animation
  114. jQuery(window).scroll(function() {
  115. if (jQuery(this).scrollTop() < 150) {
  116. jQuery(".scroll_title").hide();
  117. }
  118. else {
  119. jQuery(".scroll_title").show('fast');
  120. }
  121. });
  122. /* ]]> */
  123. </script>
  124. <?php } ?>
  125.  
  126. <?php if(of_get_option('ajaxd_checkbox') == "1"){ ?>
  127. <script type="text/javascript">
  128. /* <![CDATA[ */
  129. //AJAX PAGINATION
  130. jQuery(document).ready(function(){
  131. jQuery('.amp_next, .amp_prev').css({"display":"none"});
  132. jQuery('.znn_paginate a:first').each(function () {
  133. var href = jQuery(this).attr('href');
  134. jQuery(this).attr('href', href + '?paged=1');
  135. });
  136.  
  137. jQuery('.znn_paginate a').each(function(){
  138. this.href = this.href.replace('/page/', '?paged=');
  139. });
  140. jQuery('.znn_paginate a').live('click', function(e) {
  141. jQuery('.znn_paginate a, span.amp_page').removeClass('amp_current'); // remove if already existant
  142. jQuery(this).addClass('amp_current');
  143.  
  144. <?php if(of_get_option('layout_images') == "layout1"){ ?>
  145. e.preventDefault();
  146. var link = jQuery(this).attr('href');
  147. jQuery('.lay1_wrap').html('<div class="zn_ajaxwrap"><div class="zn_ajax"></div></div>').load(link + '.lay1_wrap .post', function() {
  148. var divs = jQuery(".lay1 .post");
  149. for(var i = 0; i < divs.length; i+=3) {
  150. divs.slice(i, i+3).wrapAll("<div class='zn_row'></div>"); }
  151. jQuery('.lay1_wrap').fadeIn(500); });
  152. <?php } ?>
  153.  
  154. });
  155. }); // end ready function
  156. /* ]]> */
  157. </script>
  158. <?php } ?>
  159.  
  160.  
  161. <?php }
  162.  
  163. //Zenon get the first image of the post Function
  164. function znn_get_images($overrides = '', $exclude_thumbnail = false)
  165. {
  166. return get_posts(wp_parse_args($overrides, array(
  167. 'numberposts' => -1,
  168. 'post_parent' => get_the_ID(),
  169. 'post_type' => 'attachment',
  170. 'post_mime_type' => 'image',
  171. 'order' => 'ASC',
  172. 'exclude' => $exclude_thumbnail ? array(get_post_thumbnail_id()) : array(),
  173. 'orderby' => 'menu_order ID'
  174. )));
  175. }
  176.  
  177.  
  178. // Change what's hidden by default
  179. add_filter('default_hidden_meta_boxes', 'znn_hidden_meta_boxes', 10, 2);
  180. function znn_hidden_meta_boxes($hidden, $screen) {
  181. if ( 'post' == $screen->base || 'page' == $screen->base || 'slider' == $screen->base )
  182. $hidden = array('slugdiv', 'trackbacksdiv', 'commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv');
  183. // removed 'postcustom',
  184. return $hidden;
  185. }
  186.  
  187.  
  188. //Custom Excerpt Length
  189. function znn_excerptlength_teaser($length) {
  190. return 33;
  191. }
  192. function znn_excerptlength_index($length) {
  193. return 12;
  194. }
  195. function znn_excerptmore($more) {
  196. return '...';
  197. }
  198.  
  199. function znn_excerpt($length_callback='', $more_callback='') {
  200. global $post;
  201. if(function_exists($length_callback)){
  202. add_filter('excerpt_length', $length_callback);
  203. }
  204. if(function_exists($more_callback)){
  205. add_filter('excerpt_more', $more_callback);
  206. }
  207. $output = get_the_excerpt();
  208. $output = apply_filters('wptexturize', $output);
  209. $output = apply_filters('convert_chars', $output);
  210. $output = '<p>'.$output.'</p>';
  211. echo $output;
  212. }
  213.  
  214. //SIDEBAR
  215. function znn_widgets_init(){
  216. register_sidebar(array(
  217. 'name' => __('Right Sidebar', 'zenon'),
  218. 'id' => 'sidebar',
  219. 'description' => __('Right Sidebar', 'zenon'),
  220. 'before_widget' => '<li id="%1$s" class="widget %2$s"><div class="widget_top"></div><div class="widget_wrap">',
  221. 'after_widget' => '</div><div class="widget_bottom"></div>',
  222. 'before_title' => '<h3 class="widgettitle">',
  223. 'after_title' => '</h3>'
  224. ));
  225.  
  226. register_sidebar(array(
  227. 'name' => __('Footer Widgets', 'zenon'),
  228. 'id' => 'foot_sidebar',
  229. 'description' => __('Widget Area for the Footer', 'zenon'),
  230. 'before_widget' => '<li id="%1$s" class="widget %2$s"><div class="widget_wrap">',
  231. 'after_widget' => '</div>',
  232. 'before_title' => '<h3 class="widgettitle">',
  233. 'after_title' => '</h3>'
  234. ));
  235. register_sidebars( 1,
  236. array(
  237. 'name' => 'widgetized-page-top',
  238. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  239. 'after_widget' => '</div>',
  240. 'before_title' => '<h2 class="widgettitle">',
  241. 'after_title' => '</h2>'
  242. )
  243. );
  244. register_sidebars( 1,
  245. array(
  246. 'name' => 'widgetized-page-bottom',
  247. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  248. 'after_widget' => '</div>',
  249. 'before_title' => '<h2 class="widgettitle">',
  250. 'after_title' => '</h2>'
  251. )
  252. );
  253. register_sidebars( 1,
  254. array(
  255. 'name' => 'widgetized-header-middle',
  256. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  257. 'after_widget' => '</div>',
  258. 'before_title' => '<h2 class="widgettitle">',
  259. 'after_title' => '</h2>'
  260. )
  261. );
  262. register_sidebars( 1,
  263. array(
  264. 'name' => 'widgetized-under-slider',
  265. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  266. 'after_widget' => '</div>',
  267. 'before_title' => '<h2 class="widgettitle">',
  268. 'after_title' => '</h2>'
  269. )
  270. );
  271. register_sidebars( 1,
  272. array(
  273. 'name' => 'widgetized-under-blocks',
  274. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  275. 'after_widget' => '</div>',
  276. 'before_title' => '<h2 class="widgettitle">',
  277. 'after_title' => '</h2>'
  278. )
  279. );
  280. register_sidebars( 1,
  281. array(
  282. 'name' => 'widgetized-under-posts',
  283. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  284. 'after_widget' => '</div>',
  285. 'before_title' => '<h2 class="widgettitle">',
  286. 'after_title' => '</h2>'
  287. )
  288. );
  289. register_sidebars( 1,
  290. array(
  291. 'name' => 'widgetized-over-footer',
  292. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  293. 'after_widget' => '</div>',
  294. 'before_title' => '<h2 class="widgettitle">',
  295. 'after_title' => '</h2>'
  296. )
  297. );
  298. register_sidebars( 1,
  299. array(
  300. 'name' => 'widgetized-over-feed',
  301. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  302. 'after_widget' => '</div>',
  303. 'before_title' => '<h2 class="widgettitle">',
  304. 'after_title' => '</h2>'
  305. )
  306. );
  307. add_action( 'widgets_init', 'znn_widgets_init' );
  308.  
  309. //ZENON COMMENTS
  310. function znn_comment($comment, $args, $depth) {
  311. $GLOBALS['comment'] = $comment; ?>
  312. <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
  313. <div class="single_skew_comm">
  314. <div class="skew_top_big"></div>
  315. <div class="skew_top_right"></div>
  316. </div>
  317.  
  318. <div id="comment-<?php comment_ID(); ?>" class="comment-body">
  319. <div class="comment-author vcard">
  320. <div class="avatar"><?php echo get_avatar($comment,$size='50' ); ?></div>
  321. </div>
  322. <div class="comment-meta commentmetadata">
  323. <?php printf(__('<cite class="fn">%s</cite>'), get_comment_author_link()) ?> <?php _e('on' , 'zenon'); ?> <a class="comm_date"><?php printf(get_comment_date()) ?></a> <a class="comm_time"><?php printf( get_comment_time()) ?></a>
  324. </div>
  325. <?php if ($comment->comment_approved == '0') : ?>
  326. <em><?php _e('Your comment is awaiting moderation.', 'zenon') ?></em>
  327. <br />
  328. <?php endif; ?>
  329.  
  330. <div class="org_comment"><?php comment_text() ?>
  331. <div class="comm_meta_reply">
  332. <div class="comm_reply"><?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?></div>
  333. <div class='comm_edit'><?php edit_comment_link(__('Edit', 'zenon'),' ','') ?></div></div>
  334. </div>
  335.  
  336. </div><div class="single_skew">
  337. <div class="skew_bottom_big"></div>
  338. <div class="skew_bottom_right"></div>
  339. </div>
  340. <?php
  341. }
  342.  
  343. //ZENON TRACKBACKS & PINGS
  344. function znn_ping($comment, $args, $depth) {
  345.  
  346. $GLOBALS['comment'] = $comment; ?>
  347.  
  348. <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
  349.  
  350. <div id="comment-<?php comment_ID(); ?>" class="comment-body">
  351. <?php if ($comment->comment_approved == '0') : ?>
  352. <em><?php _e('Your comment is awaiting moderation.', 'zenon') ?></em>
  353. <br />
  354. <?php endif; ?>
  355.  
  356. <div class="org_ping">
  357. <?php printf(__('<cite class="citeping">%s</cite> <span class="says">:</span>'), get_comment_author_link()) ?>
  358. <?php comment_text() ?>
  359. <div class="comment-meta commentmetadata">
  360. <a class="comm_date"><?php printf(get_comment_date()) ?></a>
  361. <a class="comm_time"><?php printf( get_comment_time()) ?></a>
  362. <div class='comm_edit'><?php edit_comment_link(__('Edit', 'zenon'),' ','') ?></div></div>
  363. </div>
  364. </div>
  365.  
  366.  
  367. <?php }
  368.  
  369. //Add Custom Slider Post
  370. add_action('init', 'znn_slider_register');
  371.  
  372. function znn_slider_register() {
  373.  
  374. $labels = array(
  375. 'name' => __('Slider', 'zenon'),
  376. 'singular_name' => __('Slider Item', 'zenon'),
  377. 'add_new' => __('Add New', 'zenon'),
  378. 'add_new_item' => __('Add New Slide', 'zenon'),
  379. 'edit_item' => __('Edit Slides', 'zenon'),
  380. 'new_item' => __('New Slider', 'zenon'),
  381. 'view_item' => __('View Sliders', 'zenon'),
  382. 'search_items' => __('Search Sliders', 'zenon'),
  383. 'menu_icon' => get_stylesheet_directory_uri() . 'images/article16.png',
  384. 'not_found' => __('Nothing found', 'zenon'),
  385. 'not_found_in_trash' => __('Nothing found in Trash', 'zenon'),
  386. 'parent_item_colon' => ''
  387. );
  388.  
  389. $args = array(
  390. 'labels' => $labels,
  391. 'public' => true,
  392. 'exclude_from_search' => true,
  393. 'publicly_queryable' => true,
  394. 'show_ui' => true,
  395. 'query_var' => true,
  396. 'menu_icon' => get_stylesheet_directory_uri() . '/images/slides.png',
  397. 'rewrite' => false,
  398. 'capability_type' => 'post',
  399. 'hierarchical' => false,
  400. 'menu_position' => null,
  401. 'supports' => array('title','excerpt','thumbnail'),
  402. 'register_meta_box_cb' => 'znn_add_meta'
  403. );
  404.  
  405. register_post_type( 'slider' , $args );
  406. }
  407. //Slider Link Meta Box
  408. add_action("admin_init", "znn_add_meta");
  409.  
  410. function znn_add_meta(){
  411. add_meta_box("znn_credits_meta", "Link", "znn_credits_meta", "slider", "normal", "low");
  412. }
  413.  
  414.  
  415. function znn_credits_meta( $post ) {
  416.  
  417. // Use nonce for verification
  418. $znndata = get_post_meta($post->ID, 'znn_slide_link', TRUE);
  419. wp_nonce_field( 'znn_meta_box_nonce', 'meta_box_nonce' );
  420.  
  421. // The actual fields for data entry
  422. echo '<input type="text" id="znn_sldurl" name="znn_sldurl" value="'.$znndata.'" size="75" />';
  423. }
  424.  
  425. //Save Slider Link Value
  426. add_action('save_post', 'znn_save_details');
  427. function znn_save_details($post_id){
  428. if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
  429. return;
  430.  
  431. if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'znn_meta_box_nonce' ) ) return;
  432.  
  433. if ( !current_user_can( 'edit_post', $post_id ) )
  434. return;
  435.  
  436. $znndata = esc_url( $_POST['znn_sldurl'] );
  437. update_post_meta($post_id, 'znn_slide_link', $znndata);
  438. return $znndata;
  439. }
  440.  
  441.  
  442.  
  443. add_action('do_meta_boxes', 'znn_slider_image_box');
  444.  
  445. function znn_slider_image_box() {
  446. remove_meta_box( 'postimagediv', 'slider', 'side' );
  447. add_meta_box('postimagediv', __('Slide Image', 'zenon'), 'post_thumbnail_meta_box', 'slider', 'normal', 'high');
  448. }
  449.  
  450. /*
  451. * Loads the Options Panel
  452. */
  453.  
  454. if ( !function_exists( 'optionsframework_init' ) ) {
  455.  
  456. /* Set the file path based on whether we're in a child theme or parent theme */
  457.  
  458. if ( STYLESHEETPATH == TEMPLATEPATH ) {
  459. define('OPTIONS_FRAMEWORK_URL', TEMPLATEPATH . '/admin/');
  460. define('OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/admin/');
  461. } else {
  462. define('OPTIONS_FRAMEWORK_URL', STYLESHEETPATH . '/admin/');
  463. define('OPTIONS_FRAMEWORK_DIRECTORY', get_stylesheet_directory_uri() . '/admin/');
  464. }
  465.  
  466. require_once (OPTIONS_FRAMEWORK_URL . 'options-framework.php');
  467. }
  468.  
  469. include(TEMPLATEPATH . '/lib/script/pagination.php');
  470. include(TEMPLATEPATH . '/lib/includes/shortcodes.php');
  471. include(TEMPLATEPATH . '/lib/includes/widgets.php');
  472. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement