Guest User

http://pl.forums.wordpress.org/topic/syntax-error-functionsp

a guest
Nov 9th, 2012
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.53 KB | None | 0 0
  1. <?php
  2.  
  3. // Set Content Width
  4. if ( ! isset( $content_width ) )
  5.     $content_width = 580;
  6.  
  7. /*==================================== THEME SETUP ====================================*/
  8.  
  9. // Load default style.css and Javascripts
  10. add_action('wp_enqueue_scripts', 'themezee_enqueue_scripts');
  11.  
  12. if ( ! function_exists( 'themezee_enqueue_scripts' ) ):
  13. function themezee_enqueue_scripts() {
  14.  
  15.     // Register and Enqueue Stylesheet
  16.     wp_register_style('zee_stylesheet', get_stylesheet_directory_uri() . '/style.css');
  17.     wp_enqueue_style('zee_stylesheet');
  18.  
  19.     // Enqueue jQuery Framework
  20.     wp_enqueue_script('jquery');
  21.  
  22.     // Register and enqueue the Malsup Cycle Plugin
  23.     wp_register_script('zee_jquery-cycle', get_template_directory_uri() .'/includes/js/jquery.cycle.all.min.js', array('jquery'));
  24.     wp_enqueue_script('zee_jquery-cycle');
  25. }
  26. endif;
  27.  
  28. // Setup Function: Registers support for various WordPress features
  29. add_action( 'after_setup_theme', 'themezee_setup' );
  30.  
  31. if ( ! function_exists( 'themezee_setup' ) ):
  32. function themezee_setup() {
  33.  
  34.     // init Localization
  35.     load_theme_textdomain('themezee_lang', get_template_directory() . '/includes/lang' );
  36.  
  37.     // Add Theme Support
  38.     add_theme_support('post-thumbnails');
  39.     add_theme_support('automatic-feed-links');
  40.     add_editor_style();
  41.  
  42.     // Add Custom Background
  43.     add_theme_support('custom-background', array('default-color' => 'ddd'));
  44.  
  45.     // Add Custom Header
  46. ?>
  47. <object width="980" height="270">
  48. <param name="movie" value="somefilename.swf">
  49. <embed src="http://www.konta-forex.pl/wp-content/uploads/2012/11/oferty-domow-maklerskich.swf" width="980" height="270">
  50. </embed>
  51. </object>
  52. <?php
  53.     add_theme_support('custom-header', array(
  54.         'default-image' => get_template_directory_uri() . '/images/default_header.jpg',
  55.         'header-text' => false,
  56.         'width' => 980,
  57.         'height' => 270,
  58.         'flex-height' => true,
  59.         'wp-head-callback' => 'themezee_header_style'));
  60.  
  61.     // Register Navigation Menus
  62.     register_nav_menu( 'top_navi', 'Top Navigation' );
  63.     register_nav_menu( 'main_navi', 'Main Navigation' );
  64. }
  65. endif;
  66.  
  67. // Defines extra CSS for Custom Header
  68. function themezee_header_style() {
  69.     ?><style type="text/css">
  70.         #custom_header img {
  71.             margin-bottom: -3px;
  72.                         width: 980px;
  73.                         height: 270;
  74.                         align: center;
  75.         }
  76.     </style><?php
  77. }
  78.  
  79. // Register Sidebars
  80. add_action( 'widgets_init', 'themezee_register_sidebars' );
  81.  
  82. if ( ! function_exists( 'themezee_register_sidebars' ) ):
  83. function themezee_register_sidebars() {
  84.  
  85.     // Register Sidebars
  86.     register_sidebar(array('name' => 'Sidebar Blog','id' => 'sidebar-blog'));
  87.     register_sidebar(array('name' => 'Sidebar Pages','id' => 'sidebar-pages'));
  88.  
  89.     // Register Footer Bars
  90.     register_sidebar(array('name' => 'Footer','id' => 'sidebar-footer'));
  91. }
  92. endif;
  93.  
  94. /*==================================== INCLUDE FILES ====================================*/
  95.  
  96. // Includes all files needed for theme options, custom JS/CSS and Widgets
  97. add_action( 'after_setup_theme', 'themezee_include_files' );
  98.  
  99. if ( ! function_exists( 'themezee_include_files' ) ):
  100. function themezee_include_files() {
  101.  
  102.     // include Admin Files
  103.     locate_template('/includes/admin/theme-functions.php', true);
  104.     locate_template('/includes/admin/theme-admin.php', true);
  105.  
  106.     // include custom Javascript and custom CSS Handler files
  107.     locate_template('/includes/js/jscript.php', true);
  108.     locate_template('/includes/css/csshandler.php', true);
  109.  
  110.     // include Widget Files
  111.     locate_template('/includes/widgets/theme-widget-ads.php', true);
  112.     locate_template('/includes/widgets/theme-widget-socialmedia.php', true);
  113. }
  114. endif;
  115.  
  116. /*==================================== THEME FUNCTIONS ====================================*/
  117.  
  118. // Add Default Menu Fallback Function
  119. function themezee_default_menu() {
  120.     echo '<ul id="nav" class="menu">'. wp_list_pages('title_li=&echo=0') .'</ul>';
  121. }
  122.  
  123. // Display Credit Link Function
  124. function themezee_credit_link() { ?>
  125.     <a href="http://themezee.com/"><?php _e('WordPress Theme by ThemeZee', 'themezee_lang'); ?></a>
  126. <?php
  127. }
  128.  
  129. // Change Excerpt Length
  130. add_filter('excerpt_length', 'themezee_excerpt_length');
  131. function themezee_excerpt_length($length) {
  132.     return 30;
  133. }
  134.  
  135. // Change Excerpt More
  136. add_filter('excerpt_more', 'themezee_excerpt_more');
  137. function themezee_excerpt_more($more) {
  138.     return '';
  139. }
  140.  
  141. // Add Postmeta Data
  142. add_action( 'themezee_display_postmeta_index', 'themezee_postmeta_content' );
  143. add_action( 'themezee_display_postmeta_single', 'themezee_postmeta_content' );
  144.  
  145. function themezee_postmeta_content() { ?>
  146.     <span class="date"><a href="<?php the_permalink() ?>"><?php the_time(get_option('date_format')); ?></a> </span>
  147.     <span class="author"><?php the_author_posts_link(); ?> </span>
  148.     <span class="folder"><?php the_category(', ') ?> </span>
  149. <?php
  150. }
  151.  
  152. // Add Postinfo Data
  153. add_action( 'themezee_display_postinfo_index', 'themezee_postinfo_content' );
  154. add_action( 'themezee_display_postinfo_single', 'themezee_postinfo_content' );
  155.  
  156. function themezee_postinfo_content() { ?>
  157.     <span class="comment"><?php comments_popup_link( __('No comments', 'themezee_lang'),__('One comment','themezee_lang'),__('% comments','themezee_lang') ); ?></span>
  158. <?php if (get_the_tags()) : ?>
  159.     <span class="tag"><?php the_tags('', ', '); ?> </span>
  160. <?php
  161.     endif;
  162.     edit_post_link(__( 'Edit', 'themezee_lang' ), ' | ');
  163. }
  164.  
  165. ?>
Add Comment
Please, Sign In to add comment