tag based on what is being viewed. * * @param string $title Default title text for current view. * @param string $sep Optional separator. * @return string The filtered title. */ if ( ! function_exists( 'theme_name_wp_title' ) ) { function theme_name_wp_title( $title, $sep ) { if ( is_feed() ) { return $title; } global $page, $paged; // Add the blog name $title .= get_bloginfo( 'name', 'display' ); // Add the blog description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) { $title .= " $sep $site_description"; } // Add a page number if necessary: if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) { $title .= " $sep " . sprintf( __( 'Page %s', 'progress' ), max( $paged, $page ) ); } if( is_front_page() ) { return __( 'Home', 'progress' ) . ' | ' . get_bloginfo( 'name' ); } return $title; } add_filter( 'wp_title', 'theme_name_wp_title', 10, 2 ); } /** * ---------------------------------------------------------------------------------------- * 6.0 - Set up theme default and register various supported features. * ---------------------------------------------------------------------------------------- */ if ( ! function_exists( 'progress_setup' ) ) { function progress_setup() { /** * Make the theme available for translation. */ $lang_dir = THEMEROOT . '/languages'; load_theme_textdomain( 'progress', $lang_dir ); /** * Add support for post formats. */ add_theme_support( 'post-formats', array( 'gallery', 'link', 'image', 'quote', 'video', 'audio' ) ); /** * Add support for automatic feed links. */ add_theme_support( 'automatic-feed-links' ); /** * Add support for post thumbnails. */ add_theme_support( 'post-thumbnails' ); /** * Add support for custom-background. */ add_theme_support( 'custom-background' ); /** * Add support for title-tag. */ add_theme_support( 'title-tag' ); /** * Add support for custom-header. */ $args = array( 'width' => 2000, 'height' => 32, 'default-image' => '', 'header-text' => true, 'default-text-color' => '#979797', 'wp-head-callback' => 'progress_header_style', ); add_theme_support( 'custom-header', $args ); if ( ! function_exists( 'progress_header_style' ) ) { function progress_header_style() { $header_text_color = get_header_textcolor(); // If no custom options for text are set, let's bail // get_header_textcolor() options: HEADER_TEXTCOLOR is default, hide text (returns 'blank') or any hex value if ( HEADER_TEXTCOLOR == $header_text_color ) { return; } // If we get this far, we have custom styles. Let's do this. ?> __( 'Main Menu', 'progress' ), 'error-menu' => __( 'Error Page Menu', 'progress' ), ) ); } add_action( 'after_setup_theme', 'progress_setup' ); } /** * ---------------------------------------------------------------------------------------- * 7.0 - Display meta information for a specific post. * ---------------------------------------------------------------------------------------- */ if ( ! function_exists( 'progress_post_meta' ) ) { function progress_post_meta() { if ( get_post_type() === 'post' ) { // If the post is sticky, mark it. if ( is_sticky() ) { echo '
  • ' . __( 'Sticky', 'progress' ) . '
  • '; } // Get the post author. printf( ' %2$s / ', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), get_the_author() ); // The tags. $tag_list = get_the_tag_list( '', ', ' ); if ( $tag_list ) { echo ' Tags: ' . $tag_list . ' / '; } // Comments link. if ( comments_open() ) : echo ' '; comments_popup_link( __( 'Comments (0)', 'progress' ), __( 'Comments (1)', 'progress' ), __( 'Comments (%)', 'progress' )); endif; // Edit link. if ( is_user_logged_in() ) { echo ' / '; edit_post_link( __( 'Edit', 'progress' ), ' ', '' ); } } } } /** * ---------------------------------------------------------------------------------------- * 8.0 - Display navigation to the next/previous set of posts. * ---------------------------------------------------------------------------------------- */ if ( ! function_exists( 'progress_paging_nav' ) ) { function progress_paging_nav() { ?> __( 'Main Widget Area', 'progress' ), 'id' => 'sidebar-1', 'description' => __( 'Appears on posts and pages.', 'progress' ), 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '
    ', 'after_title' => '
    ', ) ); register_sidebar( array( 'name' => __( 'Footer Widget Area', 'progress' ), 'id' => 'sidebar-2', 'description' => __( 'Appears on the footer.', 'progress' ), 'before_widget' => ' ', 'before_title' => '
    ', 'after_title' => '
    ', ) ); } } add_action( 'widgets_init', 'progress_widget_init' ); } /** * ---------------------------------------------------------------------------------------- * 10.0 - Comments list. * ---------------------------------------------------------------------------------------- */ if ( ! function_exists( 'progress_comment' ) ) { function progress_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; extract($args, EXTR_SKIP); if ( 'div' == $args['style'] ) { $tag = 'div'; $add_below = 'comment'; } else { $tag = 'li'; $add_below = 'div-comment'; } ?> < id="comment-">
    Posted by %s %2$s

    ', 'progress' ), get_comment_author_link(), get_comment_date('F jS, Y') ); ?>
    $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>

    comment_approved == '0' ) : ?>
    Read more

    '; } /** * ---------------------------------------------------------------------------------------- * 12.0 - Function that validates a field's length. * ---------------------------------------------------------------------------------------- */ if ( ! function_exists( 'progress_validate_length' ) ) { function progress_validate_length( $fieldValue, $minLength ) { // First, remove trailing and leading whitespace return ( strlen( trim( $fieldValue ) ) > $minLength ); } } /** * ---------------------------------------------------------------------------------------- * 13.0 - Load the custom scripts for the theme. * ---------------------------------------------------------------------------------------- */ if ( ! function_exists( 'progress_scripts' ) ) { function progress_scripts() { // Adds support for pages with threaded comments if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } // Register scripts wp_register_script( 'jquery', SCRIPTS . '/jquery.js', array(), false, true ); wp_register_script( 'bootstrap-js', SCRIPTS . '/bootstrap.min.js', array( 'jquery' ), false, true ); wp_register_script( 'waypoints', SCRIPTS . '/waypoints.min.js', array( 'jquery' ), false, true ); wp_register_script( 'count-up', SCRIPTS . '/jquery.counterup.min.js', array( 'jquery' ), false, true ); wp_register_script( 'circliful', SCRIPTS . '/jquery.circliful.min.js', array( 'jquery' ), false, true ); wp_register_script( 'jquery-easing', SCRIPTS . '/jquery.easing.min.js', array( 'jquery' ), false, true ); wp_register_script( 'jquery-fittext', SCRIPTS . '/jquery.fittext.js', array( 'jquery' ), false, true ); wp_register_script( 'wow', SCRIPTS . '/wow.min.js', array( 'jquery' ), false, true ); wp_register_script( 'move', SCRIPTS . '/move.min.js', array( 'jquery' ), false, true ); wp_register_script( 'google-map', 'http://maps.google.com/maps/api/js?sensor=false', array(), false, false); wp_register_script( 'progress-custom', SCRIPTS . '/main.js', array( 'jquery' ), false, true ); wp_register_script( 'custom-js', SCRIPTS . '/custom-js.js', array( 'jquery' ), false, true ); $dataToBePassed = array( 'longitude'=> get_theme_mod( 'longitude' ), 'latitude' => get_theme_mod( 'latitude' ), 'map_marker' => get_template_directory_uri() . '/images/maps-marker.png' ); wp_localize_script( 'progress-custom', 'php_vars', $dataToBePassed ); // Load the custom scripts wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'bootstrap-js' ); wp_enqueue_script( 'waypoints' ); wp_enqueue_script( 'count-up' ); wp_enqueue_script( 'circliful' ); wp_enqueue_script( 'jquery-easing' ); wp_enqueue_script( 'jquery-fittext' ); wp_enqueue_script( 'wow' ); wp_enqueue_script( 'move' ); wp_enqueue_script( 'google-map' ); wp_enqueue_script( 'progress-custom' ); wp_enqueue_script( 'custom-js' ); // Load the stylesheets wp_enqueue_style( 'animate', THEMEROOT . '/css/animate.min.css' ); wp_enqueue_style( 'jquery-circliful', THEMEROOT . '/css/jquery.circliful.css' ); wp_enqueue_style( 'progress-master', THEMEROOT . '/css/main.css' ); wp_enqueue_style( 'custom-style', THEMEROOT . '/css/custom-style.css' ); } add_action( 'wp_enqueue_scripts', 'progress_scripts' ); } ?>