Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_action( 'after_setup_theme', 'coronado_setup' );
- function coronado_setup()
- {
- load_theme_textdomain( 'coronado', get_template_directory() . '/languages' );
- add_theme_support( 'automatic-feed-links' );
- add_theme_support( 'post-thumbnails' );
- $args = array(
- 'width' => 710,
- 'height' => 225,
- 'default-image' => get_template_directory_uri() . '/images/coronado.jpg',
- 'uploads' => true,
- );
- add_theme_support( 'custom-header', $args );
- $defaults = array(
- 'default-color' => '',
- 'default-image' => '',
- 'default-repeat' => '',
- 'default-position-x' => '',
- 'wp-head-callback' => '_custom_background_cb',
- 'admin-head-callback' => '',
- 'admin-preview-callback' => ''
- );
- add_theme_support( 'custom-background', $defaults );
- $wp_customize->add_section( 'coronado_footer' , array(
- 'title' => __('Custom Footer','coronado'),
- 'width' => 710,
- 'height' => 55,
- 'default-image' => get_template_directory_uri() . '/images/coronado-bottom.jpg',
- 'uploads' => true,
- 'transport' => 'postMessage'
- ) );
- $wp_customize->add_setting( 'coronado_footer', array(
- 'default' => '',
- 'type' => 'theme_mod',
- 'capability' => 'edit_theme_options',
- ) );
- $wp_customize->add_control( WP_Customize_Image_Control( $wp_customize,
- array(
- 'label' => __( 'Custom Footer', 'coronado' ),
- 'section' => 'coronado_footer',
- 'settings' => 'coronado_theme_options[coronado_footer]',
- ) ) );
- add_action( 'customize_register', 'coronado_customize_register' );
- function coronado_customize_register($wp_customize) {
- $wp_customize->add_section( 'coronado_footer_image', array(
- 'title' => __('Custom Footer','coronado'),
- 'width' => 710,
- 'height' => 55,
- 'default-image' => get_template_directory_uri() . '/images/coronado-bottom.jpg',
- 'uploads' => true,
- 'priority' => 35,
- ) );
- if ( $wp_customize->is_preview() && ! is_admin() )
- add_action( 'wp_footer', 'coronado_customize_preview', 21);
- function themename_customize_preview() {
- ?>
- <script type="text/javascript">
- ( function( $ ){
- wp.customize('setting_name',function( value ) {
- value.bind(function(to) {
- $('#footer-pic').css('background-image', to ? to : '' );
- });
- });
- } )( jQuery )
- </script>
- global $content_width;
- if ( ! isset( $content_width ) ) $content_width = 640;
- register_nav_menus(
- array( 'main-menu' => __( 'Main Menu', 'coronado' ) )
- );
- }
- function greenapples_add_editor_styles() {
- add_editor_style( 'custom-editor-style.css' );
- }
- add_action( 'wp_enqueue_scripts', 'coronado_load_scripts' );
- function coronado_load_scripts()
- {
- wp_enqueue_script( 'jquery' );
- }
- add_action( 'comment_form_before', 'coronado_enqueue_comment_reply_script' );
- function coronado_enqueue_comment_reply_script()
- {
- if ( get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); }
- }
- add_filter( 'the_title', 'coronado_title' );
- function coronado_title( $title ) {
- if ( $title == '' ) {
- return '→';
- } else {
- return $title;
- }
- }
- add_filter( 'wp_title', 'coronado_filter_wp_title' );
- function coronado_filter_wp_title( $title )
- {
- return $title . esc_attr( get_bloginfo( 'name' ) );
- }
- add_action( 'widgets_init', 'coronado_widgets_init' );
- function coronado_widgets_init()
- {
- register_sidebar( array (
- 'name' => __( 'Sidebar Widget Area', 'coronado' ),
- 'id' => 'primary-widget-area',
- 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
- 'after_widget' => "</li>",
- 'before_title' => '<h3 class="widget-title">',
- 'after_title' => '</h3>',
- ) );
- }
- function coronado_custom_pings( $comment )
- {
- $GLOBALS['comment'] = $comment;
- ?>
- <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>"><?php echo comment_author_link(); ?></li>
- <?php
- }
- add_filter( 'get_comments_number', 'coronado_comments_number' );
- function coronado_comments_number( $count )
- {
- if ( !is_admin() ) {
- global $id;
- $comments_by_type = &separate_comments( get_comments( 'status=approve&post_id=' . $id ) );
- return count( $comments_by_type['comment'] );
- } else {
- return $count;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement