Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Starkers functions and definitions
- *
- * For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API.
- *
- * @package WordPress
- * @subpackage Starkers
- * @since Starkers 4.0
- */
- /* ========================================================================================================================
- Required external files
- ======================================================================================================================== */
- require_once( 'external/starkers-utilities.php' );
- /* ========================================================================================================================
- Theme specific settings
- Uncomment register_nav_menus to enable a single menu with the title of "Primary Navigation" in your theme
- ======================================================================================================================== */
- add_theme_support('post-thumbnails');
- register_nav_menus(array('primary' => 'Primary Navigation'));
- if ( function_exists('register_sidebar') )
- register_sidebar();
- /* ========================================================================================================================
- Actions and Filters
- ======================================================================================================================== */
- add_action( 'wp_enqueue_scripts', 'starkers_script_enqueuer' );
- add_filter( 'body_class', array( 'Starkers_Utilities', 'add_slug_to_body_class' ) );
- /* ========================================================================================================================
- Custom Post Types - include custom post types and taxonimies here e.g.
- e.g. require_once( 'custom-post-types/your-custom-post-type.php' );
- ======================================================================================================================== */
- /* ========================================================================================================================
- Woocommerce overrides
- ======================================================================================================================== */
- add_filter( 'add_to_cart_text', 'woo_custom_cart_button_text' );
- function woo_custom_cart_button_text() {
- return __( 'Add to basket', 'woocommerce' );
- }
- add_filter('single_add_to_cart_text', 'woo_custom_cart_button_text');
- function woo_custom_cart_button_text() {
- return __('Add to basket', 'woocommerce');
- }
- /* ========================================================================================================================
- Scripts
- ======================================================================================================================== */
- /**
- * Add scripts via wp_head()
- *
- * @return void
- * @author Keir Whitaker
- */
- function starkers_script_enqueuer() {
- wp_register_script( 'site', get_template_directory_uri().'/js/site.js', array( 'jquery' ) );
- wp_enqueue_script( 'site' );
- wp_register_style( 'screen', get_stylesheet_directory_uri().'/style.css', '', '', 'screen' );
- wp_enqueue_style( 'screen' );
- }
- /* ========================================================================================================================
- Comments
- ======================================================================================================================== */
- /**
- * Custom callback for outputting comments
- *
- * @return void
- * @author Keir Whitaker
- */
- function starkers_comment( $comment, $args, $depth ) {
- $GLOBALS['comment'] = $comment;
- ?>
- <?php if ( $comment->comment_approved == '1' ): ?>
- <li>
- <article id="comment-<?php comment_ID() ?>">
- <?php echo get_avatar( $comment ); ?>
- <h4><?php comment_author_link() ?></h4>
- <time><a href="#comment-<?php comment_ID() ?>" pubdate><?php comment_date() ?> at <?php comment_time() ?></a></time>
- <?php comment_text() ?>
- </article>
- <?php endif;
- }
- /* ========================================================================================================================
- Sidebars
- ======================================================================================================================== */
- // register sidebars
- if ( function_exists('register_sidebar') )
- if ( function_exists('register_sidebar') )
- register_sidebar(array('name'=>'Page Sidebar', //Name your sidebar
- 'description' => 'These widgets will appear in the basic page sidebar.',
- 'before_widget' => '<div class="widget">', // Displays before widget
- 'after_widget' => '</div>', // Displayed after widget
- 'before_title' => '<h3>', //Displays before title, after widget start
- 'after_title' => '</h3>' //Displays after title
- ));
- // register sidebars
- if ( function_exists('register_sidebar') )
- if ( function_exists('register_sidebar') )
- register_sidebar(array('name'=>'Blog Sidebar', //Name your sidebar
- 'description' => 'These widgets will appear in the blog sidebar.',
- 'before_widget' => '<div class="widget">', // Displays before widget
- 'after_widget' => '</div>', // Displayed after widget
- 'before_title' => '<h3>', //Displays before title, after widget start
- 'after_title' => '</h3>' //Displays after title
- ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement