Advertisement
Guest User

Untitled

a guest
Aug 7th, 2013
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.49 KB | None | 0 0
  1. <?php
  2.     /**
  3.      * Starkers functions and definitions
  4.      *
  5.      * For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API.
  6.      *
  7.      * @package     WordPress
  8.      * @subpackage  Starkers
  9.      * @since       Starkers 4.0
  10.      */
  11.  
  12.     /* ========================================================================================================================
  13.    
  14.     Required external files
  15.    
  16.     ======================================================================================================================== */
  17.  
  18.     require_once( 'external/starkers-utilities.php' );
  19.  
  20.     /* ========================================================================================================================
  21.    
  22.     Theme specific settings
  23.  
  24.     Uncomment register_nav_menus to enable a single menu with the title of "Primary Navigation" in your theme
  25.    
  26.     ======================================================================================================================== */
  27.  
  28.     add_theme_support('post-thumbnails');
  29.    
  30.     register_nav_menus(array('primary' => 'Primary Navigation'));
  31.  
  32.     if ( function_exists('register_sidebar') )
  33.     register_sidebar();
  34.  
  35.     /* ========================================================================================================================
  36.    
  37.     Actions and Filters
  38.    
  39.     ======================================================================================================================== */
  40.  
  41.     add_action( 'wp_enqueue_scripts', 'starkers_script_enqueuer' );
  42.  
  43.     add_filter( 'body_class', array( 'Starkers_Utilities', 'add_slug_to_body_class' ) );
  44.  
  45.  
  46.     /* ========================================================================================================================
  47.    
  48.     Custom Post Types - include custom post types and taxonimies here e.g.
  49.  
  50.     e.g. require_once( 'custom-post-types/your-custom-post-type.php' );
  51.  
  52.  
  53.    
  54.     ======================================================================================================================== */
  55.  
  56.     /* ========================================================================================================================
  57.    
  58.     Woocommerce overrides
  59.  
  60.     ======================================================================================================================== */
  61.     add_filter( 'add_to_cart_text', 'woo_custom_cart_button_text' );
  62.         function woo_custom_cart_button_text() {
  63.                     return __( 'Add to basket', 'woocommerce' );
  64.  
  65.             }
  66.  
  67.     add_filter('single_add_to_cart_text', 'woo_custom_cart_button_text');
  68.         function woo_custom_cart_button_text() {
  69.                     return __('Add to basket', 'woocommerce');
  70.             }
  71.  
  72.  
  73.  
  74.     /* ========================================================================================================================
  75.    
  76.     Scripts
  77.    
  78.     ======================================================================================================================== */
  79.  
  80.     /**
  81.      * Add scripts via wp_head()
  82.      *
  83.      * @return void
  84.      * @author Keir Whitaker
  85.      */
  86.  
  87.     function starkers_script_enqueuer() {
  88.         wp_register_script( 'site', get_template_directory_uri().'/js/site.js', array( 'jquery' ) );
  89.         wp_enqueue_script( 'site' );
  90.  
  91.         wp_register_style( 'screen', get_stylesheet_directory_uri().'/style.css', '', '', 'screen' );
  92.         wp_enqueue_style( 'screen' );
  93.     }  
  94.  
  95.     /* ========================================================================================================================
  96.    
  97.     Comments
  98.    
  99.     ======================================================================================================================== */
  100.  
  101.     /**
  102.      * Custom callback for outputting comments
  103.      *
  104.      * @return void
  105.      * @author Keir Whitaker
  106.      */
  107.     function starkers_comment( $comment, $args, $depth ) {
  108.         $GLOBALS['comment'] = $comment;
  109.         ?>
  110.         <?php if ( $comment->comment_approved == '1' ): ?> 
  111.         <li>
  112.             <article id="comment-<?php comment_ID() ?>">
  113.                 <?php echo get_avatar( $comment ); ?>
  114.                 <h4><?php comment_author_link() ?></h4>
  115.                 <time><a href="#comment-<?php comment_ID() ?>" pubdate><?php comment_date() ?> at <?php comment_time() ?></a></time>
  116.                 <?php comment_text() ?>
  117.             </article>
  118.         <?php endif;
  119.     }
  120.  
  121.  
  122.  
  123.     /* ========================================================================================================================
  124.    
  125.     Sidebars
  126.    
  127.     ======================================================================================================================== */
  128.  
  129.     // register sidebars
  130. if ( function_exists('register_sidebar') )
  131.     if ( function_exists('register_sidebar') )
  132.         register_sidebar(array('name'=>'Page Sidebar', //Name your sidebar
  133.         'description' => 'These widgets will appear in the basic page sidebar.',
  134.         'before_widget' => '<div class="widget">', // Displays before widget
  135.         'after_widget' => '</div>', // Displayed after widget
  136.         'before_title' => '<h3>', //Displays before title, after widget start
  137.         'after_title' => '</h3>' //Displays after title
  138.     ));
  139.  
  140.  
  141.         // register sidebars
  142. if ( function_exists('register_sidebar') )
  143.     if ( function_exists('register_sidebar') )
  144.         register_sidebar(array('name'=>'Blog Sidebar', //Name your sidebar
  145.         'description' => 'These widgets will appear in the blog sidebar.',
  146.         'before_widget' => '<div class="widget">', // Displays before widget
  147.         'after_widget' => '</div>', // Displayed after widget
  148.         'before_title' => '<h3>', //Displays before title, after widget start
  149.         'after_title' => '</h3>' //Displays after title
  150.     ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement