Archives shows as title instead of Events in Spacious theme?
-
Events being replaced with Archives in Spacious theme by ThemeGrill
-
Hi @ba95472 ,
Thank you for reaching out.
By default, the events archive page that is generated by the plugin does not have a title. However, some themes does include in their header a title output. In that regard, the following knowledgebase article might help.
Thanks Tristan, unfortunately this doesn’t work for the Spacious theme by ThemeGrill. I meant to post your link to say I’d already tried that and it has no effect, Archives still shows. Something else is going on.
Found it!
inc/header-functions.php
changeelse :
$spacious_header_title = __( ‘Archives’, ‘spacious’ );endif;
to
else :
$spacious_header_title = __( ‘Events’, ‘spacious’ );endif;
Can you please tell me how to modify the child-theme to do this?
-
This reply was modified 3 months, 1 week ago by
ba95472.
Figured it out. In functions.php add
// Include custom header functions require_once get_stylesheet_directory() . ‘/inc/header-functions.php’;in header-functions.php add
<?php
// Ensure this file is included only once
if ( ! function_exists( ‘spacious_header_title’ ) ) :
/**
* Show the title in the header
*/
function spacious_header_title() {
if ( is_archive() ) {
if ( is_category() ) :
$spacious_header_title = single_cat_title( ”, false );elseif ( is_tag() ) : $spacious_header_title = single_tag_title( '', false ); elseif ( is_author() ) : the_post(); $spacious_header_title = sprintf( __( 'Author: %s', 'spacious' ), '<span class="vcard">' . get_the_author() . '</span>' ); rewind_posts(); elseif ( is_day() ) : $spacious_header_title = sprintf( __( 'Day: %s', 'spacious' ), '<span>' . get_the_date() . '</span>' ); elseif ( is_month() ) : $spacious_header_title = sprintf( __( 'Month: %s', 'spacious' ), '<span>' . get_the_date( 'F Y' ) . '</span>' ); elseif ( is_year() ) : $spacious_header_title = sprintf( __( 'Year: %s', 'spacious' ), '<span>' . get_the_date( 'Y' ) . '</span>' ); elseif ( is_tax( 'post_format', 'post-format-aside' ) ) : $spacious_header_title = __( 'Asides', 'spacious' ); elseif ( is_tax( 'post_format', 'post-format-image' ) ) : $spacious_header_title = __( 'Images', 'spacious' ); elseif ( is_tax( 'post_format', 'post-format-video' ) ) : $spacious_header_title = __( 'Videos', 'spacious' ); elseif ( is_tax( 'post_format', 'post-format-quote' ) ) : $spacious_header_title = __( 'Quotes', 'spacious' ); elseif ( is_tax( 'post_format', 'post-format-link' ) ) : $spacious_header_title = __( 'Links', 'spacious' ); elseif ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) : $spacious_header_title = woocommerce_page_title( false ); else : $spacious_header_title = __( 'Events', 'spacious' ); // Changed 'Archives' to 'Events' endif; } elseif ( is_404() ) { $spacious_header_title = __( 'Page NOT Found', 'spacious' ); } elseif ( is_search() ) { $spacious_header_title = __( 'Search Results', 'spacious' ); } elseif ( is_page() ) { $spacious_header_title = get_the_title(); } elseif ( is_single() ) { $spacious_header_title = get_the_title(); } elseif ( is_home() ) { $queried_id = get_option( 'page_for_posts' ); $spacious_header_title = get_the_title( $queried_id ); } else { $spacious_header_title = ''; } return $spacious_header_title; }
endif;
This is great, @ba95472 ! You can also check and add a condition for tribe_is_events_home() so you can keep ‘Archives’ for everything else.
Hi there,
It seems like it has been some time since we received a response from you, therefore, I will consider this matter as resolved. If you require any further assistance, please do not hesitate to start a new thread.
-
This reply was modified 3 months, 1 week ago by
- You must be logged in to reply to this topic.