is_search) { $query->set('post_type', 'post'); } return $query; } add_filter('pre_get_posts','tz_exclude_pages'); /*-----------------------------------------------------------------------------------*/ /* Register WP3.0+ Menus /*-----------------------------------------------------------------------------------*/ function register_menu() { register_nav_menu('primary-menu', __('Primary Menu')); } add_action('init', 'register_menu'); /*-----------------------------------------------------------------------------------*/ /* Load Translation Text Domain /*-----------------------------------------------------------------------------------*/ load_theme_textdomain ('framework'); /*-----------------------------------------------------------------------------------*/ /* Set Max Content Width (use in conjuction with ".entry-content img" css) /*-----------------------------------------------------------------------------------*/ if ( ! isset( $content_width ) ) $content_width = 600; /*-----------------------------------------------------------------------------------*/ /* Register Sidebars /*-----------------------------------------------------------------------------------*/ if ( function_exists('register_sidebar') ) { register_sidebar(array( 'name' => 'Main Sidebar', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => 'Page Sidebar', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => 'Portfolio Sidebar', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } /*-----------------------------------------------------------------------------------*/ /* Post Formats /*-----------------------------------------------------------------------------------*/ $formats = array( 'aside', 'gallery', 'link', 'image', 'quote', 'audio', 'video'); add_theme_support( 'post-formats', $formats ); add_post_type_support( 'post', 'post-formats' ); /*-----------------------------------------------------------------------------------*/ /* Configure WP2.9+ Thumbnails /*-----------------------------------------------------------------------------------*/ if ( function_exists( 'add_theme_support' ) ) { add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 50, 50, true ); // Normal post thumbnails add_image_size( 'thumbnail-portfolio', 220, 160, true ); // Portfolio thumbnails add_image_size( 'image-thumb', 500, '', true ); // Image format thumbnails add_image_size( 'gallery-thumb', 500, '', true ); // Gallery format thumbnails } /*-----------------------------------------------------------------------------------*/ /* Change Default Excerpt Length /*-----------------------------------------------------------------------------------*/ function tz_excerpt_length($length) { return 16; } add_filter('excerpt_length', 'tz_excerpt_length'); /*-----------------------------------------------------------------------------------*/ /* Configure Excerpt String /*-----------------------------------------------------------------------------------*/ function tz_excerpt_more($excerpt) { return str_replace('[...]', '...', $excerpt); } add_filter('wp_trim_excerpt', 'tz_excerpt_more'); /*-----------------------------------------------------------------------------------*/ /* Register and load common JS /*-----------------------------------------------------------------------------------*/ function tz_enqueue_scripts() { // register our scripts wp_register_script('superfish', get_template_directory_uri() . '/js/superfish.js', 'jquery'); wp_register_script('validation', 'http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js', 'jquery'); wp_register_script('easing', get_template_directory_uri() . '/js/jquery.easing.1.3.js', 'jquery'); wp_register_script('tz_custom', get_template_directory_uri() . '/js/jquery.custom.js', 'jquery', '1.0', TRUE); wp_register_script('fancybox', get_template_directory_uri().'/js/jquery.fancybox-1.3.4.pack.js', 'jquery'); wp_register_script('slidesjs', get_template_directory_uri().'/js/slides.min.jquery.js', 'jquery'); wp_register_script('jPlayer', get_template_directory_uri().'/js/jquery.jplayer.min.js', 'jquery'); // register our stylesheets wp_register_style( 'fancybox', get_template_directory_uri() . '/css/fancybox/jquery.fancybox-1.3.4.css' ); // enqueue our scripts wp_enqueue_script('jquery'); wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('jquery-ui-tabs'); wp_enqueue_script('jquery-ui-accordion'); wp_enqueue_script('jPlayer'); wp_enqueue_script('slidesjs'); wp_enqueue_script('fancybox'); wp_enqueue_script('easing'); wp_enqueue_script('superfish'); wp_enqueue_script('tz_custom'); if( is_page_template('template-contact.php') ) { wp_enqueue_script('validation'); } if( is_singular() ) { wp_enqueue_script( 'comment-reply' ); } // enqueue our stylesheets wp_enqueue_style( 'fancybox' ); } add_action('wp_enqueue_scripts', 'tz_enqueue_scripts'); /*-----------------------------------------------------------------------------------*/ /* Register and load admin javascript /*-----------------------------------------------------------------------------------*/ function tz_admin_js($hook) { if ($hook == 'post.php' || $hook == 'post-new.php') { wp_register_script('tz-admin', get_template_directory_uri() . '/js/jquery.custom.admin.js', 'jquery'); wp_enqueue_script('tz-admin'); } } add_action('admin_enqueue_scripts','tz_admin_js',10,1); /*-----------------------------------------------------------------------------------*/ /* Add Browser Detection Body Class /*-----------------------------------------------------------------------------------*/ add_filter('body_class','tz_browser_body_class'); function tz_browser_body_class($classes) { global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone; if($is_lynx) $classes[] = 'lynx'; elseif($is_gecko) $classes[] = 'gecko'; elseif($is_opera) $classes[] = 'opera'; elseif($is_NS4) $classes[] = 'ns4'; elseif($is_safari) $classes[] = 'safari'; elseif($is_chrome) $classes[] = 'chrome'; elseif($is_IE) $classes[] = 'ie'; else $classes[] = 'unknown'; if($is_iphone) $classes[] = 'iphone'; return $classes; } /*-----------------------------------------------------------------------------------*/ /* Comment Styling /*-----------------------------------------------------------------------------------*/ function tz_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?>
  • id="li-comment-">
    comment_approved == '0') : ?>
  • h1 a { background-image:url('.get_template_directory_uri().'/images/custom-login-logo.png) !important; background-size: auto auto !important; } '; } function tz_wp_login_url() { return home_url(); } function tz_wp_login_title() { return get_option('blogname'); } add_action('login_head', 'tz_custom_login_logo'); add_filter('login_headerurl', 'tz_wp_login_url'); add_filter('login_headertitle', 'tz_wp_login_title'); /*-----------------------------------------------------------------------------------*/ /* Force Insert to Post button /*-----------------------------------------------------------------------------------*/ add_filter( 'get_media_item_args', 'tz_force_send' ); function tz_force_send($args){ $args['send'] = true; return $args; } /*-----------------------------------------------------------------------------------*/ /* Load Widgets & Shortcodes /*-----------------------------------------------------------------------------------*/ // Add the Latest Tweets Custom Widget include("functions/widget-tweets.php"); // Add the Flickr Photos Custom Widget include("functions/widget-flickr.php"); // Add the Custom Video Widget include("functions/widget-video.php"); // Add the Theme Shortcodes include("functions/theme-shortcodes.php"); // Add the post meta include("functions/theme-postmeta.php"); // Add the post types include("functions/theme-posttypes.php"); // Add the portfolio meta include("functions/theme-portfoliometa.php"); // Add the page meta include("functions/theme-pagemeta.php"); /*-----------------------------------------------------------------------------------*/ /* Filters that allow shortcodes in Text Widgets /*-----------------------------------------------------------------------------------*/ add_filter('widget_text', 'shortcode_unautop'); add_filter('widget_text', 'do_shortcode'); /*-----------------------------------------------------------------------------------*/ /* Load Theme Options /*-----------------------------------------------------------------------------------*/ define('TZ_FILEPATH', TEMPLATEPATH); define('TZ_DIRECTORY', get_template_directory_uri()); require_once (TZ_FILEPATH . '/admin/admin-functions.php'); require_once (TZ_FILEPATH . '/admin/admin-interface.php'); require_once (TZ_FILEPATH . '/functions/theme-options.php'); require_once (TZ_FILEPATH . '/functions/theme-functions.php'); require_once (TZ_FILEPATH . '/tinymce/tinymce.loader.php'); //* Enqueue Headroom add_action( 'wp_enqueue_scripts', 'sk_enqueue_scripts' ); function sk_enqueue_scripts() { if ( wp_is_mobile() ) return; wp_enqueue_style( 'animations', get_stylesheet_directory_uri() . '/css/animations.min.css' ); wp_enqueue_script( 'headroom', get_stylesheet_directory_uri() . '/js/headroom.min.js', '', '', true ); wp_enqueue_script( 'jquery-headroom', get_stylesheet_directory_uri() . '/js/jQuery.headroom.min.js', array( 'jquery' ), '1.0.0', true ); wp_enqueue_script( 'headroom-init', get_stylesheet_directory_uri() . '/js/headroom-init.js', array( 'jquery-headroom' ), '1.0.0', true ); } ?>