Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #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, 1 month ago by domchocolate.
    • This topic was modified 1 year, 1 month ago by domchocolate.
    #1422041

    Sorted 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>
    #1422065

    Hi,
    Glad to hear that you have this sorted out, shall we close this thread then?

    Best regards,
    Mike

    #1422571

    or 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);
    #1422577

    Hi,
    Thank you for sharing Guenni007.

    Best regards,
    Mike

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.