get_template_directory_uri() . '/images/logo.png', 'uploads' => true ); add_theme_support( 'custom-header', $args ); add_theme_support('automatic-feed-links'); add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 450, 300, true ); register_nav_menu( 'top-menu', 'Top Menu' ); register_nav_menu( 'footer-menu', 'Footer Menu' ); } /** * A comment reply. */ function impulse_press_enqueue_comment_reply() { if ( is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } } /* * Register the JavaScript libraries */ function impulse_press_register_scripts() { // Register the scripts for this theme: wp_register_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap-3.0.0.min.js', array( 'jquery' ),null, false ); wp_register_script( 'placeholder', get_template_directory_uri() . '/js/holder.js', array( 'jquery' ),null, false ); wp_register_script( 'scroll', get_template_directory_uri() . '/js/scroll.js', array( 'jquery' ),null, false ); wp_register_script( 'easing', get_template_directory_uri() . '/js/jquery.easing.1.3.js', array( 'jquery' ),null, false ); wp_register_script( 'validate', get_template_directory_uri() . '/js/jquery.validate.min.js', array( 'jquery' ),null, false ); wp_register_script( 'respond', get_template_directory_uri() . '/js/respond.min.js', array( 'jquery' ),null, false ); // enqueue the scripts wp_enqueue_script( 'bootstrap' ); wp_enqueue_script( 'placeholder' ); wp_enqueue_script( 'scroll' ); wp_enqueue_script( 'easing' ); wp_enqueue_script( 'validate' ); wp_enqueue_script( 'respond' ); } /* * Register stylesheets */ function impulse_press_register_styles() { // Register the styles wp_register_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', array(), null, 'all' ); wp_register_style( 'bootstrap-theme', get_template_directory_uri() . '/css/bootstrap-theme.css', array(), null, 'all' ); // Register premium styles wp_register_style( 'font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), null, 'all' ); wp_register_style( 'blueimp', get_template_directory_uri() . '/css/blueimp-gallery.css', array(), null, 'all' ); wp_register_style( 'blueimp2', get_template_directory_uri() . '/css/bootstrap-image-gallery.css', array(), null, 'all' ); wp_register_style( 'waypoints', get_template_directory_uri() . '/css/waypoints.css', array(), null, 'all' ); // enqueue the styles wp_enqueue_style('bootstrap' ); wp_enqueue_style('bootstrap-theme'); // enqueue premium styles wp_enqueue_style('font-awesome'); wp_enqueue_style('blueimp'); wp_enqueue_style('blueimp2'); wp_enqueue_style('waypoints'); } /** * Sidebar Widgets */ function impulse_press_widgets_init() { /* The Hero Unit Two */ register_sidebar(array( 'name' => __('Hero Unit Simple', 'impulse-press'), 'description' => __('Hero Unit Simple', 'impulse-press'), 'id' => 'hero-simple', 'before_title' => '
', 'after_title' => '
', 'before_widget' => '
', 'after_widget' => '
' )); /* The 3 widgets for the main page, below the heroe unit */ register_sidebar(array( 'name' => __('Main One', 'impulse-press'), 'description' => __('Main One', 'impulse-press'), 'id' => 'main-1', 'before_title' => '
', 'after_title' => '
', 'before_widget' => '
', 'after_widget' => '
' )); register_sidebar(array( 'name' => __('Main Two', 'impulse-press'), 'description' => __('Main Two', 'impulse-press'), 'id' => 'main-2', 'before_title' => '
', 'after_title' => '
', 'before_widget' => '
', 'after_widget' => '
' )); register_sidebar(array( 'name' => __('Main Three', 'impulse-press'), 'description' => __('Main Three', 'impulse-press'), 'id' => 'main-3', 'before_title' => '
', 'after_title' => '
', 'before_widget' => '
', 'after_widget' => '
' )); /* left and right sidebar */ register_sidebar(array( 'name' => 'Sidebar Left', 'description' => 'Sidebar Left', 'id' => 'sidebar-left', 'before_title' => '
', 'after_title' => '
', 'before_widget' => '
', 'after_widget' => '
' )); register_sidebar(array( 'name' => 'Sidebar Right' , 'description' => 'Sidebar Right', 'id' => 'sidebar-right', 'before_title' => '
', 'after_title' => '
', 'before_widget' => '
', 'after_widget' => '
' )); } /** * Breadcrumb Lists * Allows visitors to quickly navigate back to a previous section or the root page. * * Courtesy of Dimox * * bbPress compatibility patch by Dan Smith */ function impulse_press_breadcrumb_lists() { $chevron = '/'; $name = __('Home','impulse-press'); //text for the 'Home' link $currentBefore = '
  • '; $currentAfter = '
  • '; echo ''; } /** * ImpulsePress Page Menu generator * @param array $args options */ function impulse_press_page_menu( $args = array() ) { $defaults = array( 'sort_column' => 'menu_order, post_title', 'menu_class' => 'menu', 'container' => 'div', 'echo' => true, 'link_before' => '', 'link_after' => '', ); $args = wp_parse_args( $args, $defaults ); $args = apply_filters( 'wp_page_menu_args', $args ); $menu = ''; $list_args = $args; // Show Home in the menu if ( ! empty($args['show_home']) ) { if ( true === $args['show_home'] || '1' === $args['show_home'] || 1 === $args['show_home'] ) $text = __('Home','impulse-press'); else $text = $args['show_home']; $class = ''; if ( is_front_page() && !is_paged() ) $class = 'class="current_page_item"'; $menu .= '
  • ' . $args['link_before'] . $text . $args['link_after'] . '
  • '; // If the front page is a page, add it to the exclude list if (get_option('show_on_front') == 'page') { if ( !empty( $list_args['exclude'] ) ) { $list_args['exclude'] .= ','; } else { $list_args['exclude'] = ''; } $list_args['exclude'] .= get_option('page_on_front'); } } $list_args['echo'] = false; $list_args['title_li'] = ''; $menu .= str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages($list_args) ); if ( $menu ) { $menu = ''; } if ( $args['container'] && in_array( $args['container'], array( 'nav', 'div' ) ) ) { $tag = $args['container']; $menu = '<' . $tag . ' class="' . esc_attr($args['menu_class']) . '">' . $menu . "\n"; } $menu = apply_filters( 'wp_page_menu', $menu, $args ); if ( $args['echo'] ) echo $menu; else return $menu; } function impulse_press_set_title( $title, $sep, $seplocation ) { $sitename = get_bloginfo( 'name' ); if ( preg_match( "/(\\s|^)$sitename(\\s|$)/", $title ) === 0 ) { if ( $seplocation == 'right' ) return $title . ' '. $sitename; else return $sitename . ' ' . $title; } return $title; } add_filter('wp_title', 'impulse_press_set_title', 30, 3);