themeblvd / jumpstart

The most extensive WordPress theme for both users and developers from Theme Blvd
http://wpjumpstart.com
GNU General Public License v2.0
5 stars 2 forks source link

Archive Banner #329

Closed themeblvd closed 6 years ago

themeblvd commented 6 years ago

Add "Archive Banner" feature. Conceptually similar to #328.

Reference: http://dev.themeblvd.com/tutorial/full-width-and-parallax-banners-for-archives/

For reference, here was the original themeblvd_archive_title() function we can use as a starting point:

/**
 * Display title for archive pages
 *
 * @since 2.0.0
 */
function themeblvd_archive_title() {

    global $post;

    global $posts;
    if ( $posts ) {
        $post = $posts[0]; // Hack. Set $post so that the_date() works.
    }

    if ( is_search() ) {

        // Search Results
        echo themeblvd_get_local('crumb_search').' "'.get_search_query().'"';

    } else if ( is_category() ) {

        // If this is a category archive
        // echo themeblvd_get_local( 'category' ).': ';
        single_cat_title();

    } else if ( is_tag() ) {

        // If this is a tag archive
        echo themeblvd_get_local('crumb_tag').' "'.single_tag_title('', false).'"';

    } else if ( is_day() ) {

        // If this is a daily archive
        echo themeblvd_get_local( 'archive' ).': ';

        the_time('F jS, Y');

    } else if ( is_month()) {

        // If this is a monthly archive

        echo themeblvd_get_local( 'archive' ).': ';

        the_time('F, Y');

    } else if ( is_year()) {

        // If this is a yearly archive

        echo themeblvd_get_local( 'archive' ).': ';

        the_time('Y');

    } else if ( is_author()) {

        // If this is an author archive

        global $author;

        $userdata = get_userdata($author);

        echo themeblvd_get_local('crumb_author').' '.esc_html($userdata->display_name);

    }
}