-
AuthorPosts
-
October 10, 2023 at 4:34 pm #1422028
Hi all
I have a website at https://oxfordwestend.co.uk/
I don’t want to display the Header title on 99% of pages, so I have set Theme options > Header > Header Layout > Header Title and Breadcrumbs > Display only breadcrumbs.
However, on the archive and category pages, I would like to show the archive page title as an H1 heading for accessibility purposes. This header shouldn’t be in the breadcrumb bar; in fact, I’d prefer it as a headline just above the main content.
I can see an opportunity to display the title here:
<main class='content av-content-full alpha units' role="main" itemprop="mainContentOfPage" itemscope="itemscope" itemtype="https://schema.org/Blog" > <div class="archive-header" style="text-align: center;"><h1>[ARCHIVE TITLE SHOULD GO HERE}</h1></div>
I created this by modifying archive.php in my child theme read:
<main class='content <?php avia_layout_class( 'content' ); ?> units' <?php avia_markup_helper( array( 'context' => 'content', 'post_type' => 'post' ) );?>> <div class="archive-header" style="text-align: center;"><h1><?php post_type_archive_title(); ?></h1></div>
However, no content is currently displaying between <H1> tags. Any ideas on how I can override any settings to make this happen on archive pages?
TIA
Dominic
- This topic was modified 1 year, 2 months ago by domchocolate.
- This topic was modified 1 year, 2 months ago by domchocolate.
October 10, 2023 at 6:42 pm #1422041Sorted it – did this:
<main class='content <?php avia_layout_class( 'content' ); ?> units' <?php avia_markup_helper( array( 'context' => 'content', 'post_type' => 'post' ) );?>> <div class="archive-header" style="text-align: center;"><h1><?php post_type_archive_title(); ?><?php single_term_title(); ?></h1></div>
October 11, 2023 at 1:58 am #1422065Hi,
Glad to hear that you have this sorted out, shall we close this thread then?Best regards,
MikeOctober 15, 2023 at 6:00 pm #1422571or use a filter to show only on specific pages / posts etc. the breadcrumbs:
function avf_header_setting_filter_mod($header_settings) { if ( is_category() || is_archive() ) || has_category() { $header_settings['header_title_bar'] = "breadcrumbs_only"; } return $header_settings; } add_filter('avf_header_setting_filter', 'avf_header_setting_filter_mod', 50, 1);
October 15, 2023 at 6:30 pm #1422577 -
AuthorPosts
- You must be logged in to reply to this topic.