Page title in custom post type archive page

Hi,

Can you tell me how to simply add the h1 title ‘Events’ at the top of the page as it does on the blog page-

This is the events page

If you can let me know the php code for this ? I have a _landmark-header.php file in my child theme and im sure it needs to go in there ?

Thanks
charles

Hello There,

Thank you for the very detailed post information. To resolve your issue, please update the contents of your _landmark-header.php and make use of this code:

<?php

// =============================================================================
// VIEWS/RENEW/_LANDMARK-HEADER.PHP
// -----------------------------------------------------------------------------
// Handles content output of large headers for key pages such as the blog or
// search results.
// =============================================================================

$disable_page_title = get_post_meta( get_the_ID(), '_x_entry_disable_page_title', true );
$breadcrumbs        = x_get_option( 'x_breadcrumb_display' );

?>

<?php if ( ! x_is_blank( 1 ) && ! x_is_blank( 2 ) && ! x_is_blank( 4 ) && ! x_is_blank( 5 ) ) : ?>
  <?php if ( is_page() && $disable_page_title == 'on' ) : ?>

  <?php else : ?>

    <header class="x-header-landmark">
      <div class="x-container max width">
        <div class="x-landmark-breadcrumbs-wrap">
          <div class="x-landmark">

          <?php if ( x_is_shop() || x_is_product() ) : ?>

            <h1 class="h-landmark"><span><?php echo x_get_option( 'x_renew_shop_title' ); ?></span></h1>

          <?php elseif ( x_is_bbpress() ) : ?>

            <h1 class="h-landmark"><span><?php echo get_the_title(); ?></span></h1>

          <?php elseif ( x_is_buddypress() ) : ?>
            <?php if ( x_buddypress_is_component_with_landmark_header() ) : ?>

              <h1 class="h-landmark"><span><?php echo x_buddypress_get_the_title(); ?></span></h1>

            <?php endif; ?>
          <?php elseif ( is_page() ) : ?>

            <h1 class="h-landmark entry-title"><span><?php the_title(); ?></span></h1>

          <?php elseif ( is_home() || is_single() ) : ?>
            <?php if ( x_is_portfolio_item() ) : ?>

              <h1 class="h-landmark"><span><?php echo x_get_parent_portfolio_title(); ?></span></h1>

            <?php else : ?>

              <h1 class="h-landmark"><span><?php echo x_get_option( 'x_renew_blog_title' ); ?></span></h1>

            <?php endif; ?>
          <?php elseif ( is_search() ) : ?>

            <h1 class="h-landmark"><span><?php _e( 'Search Results', '__x__' ); ?></span></h1>

          <?php elseif ( is_category() || x_is_portfolio_category() || x_is_product_category() ) : ?>

            <?php

            $meta  = x_get_taxonomy_meta();
            $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Category Archive', '__x__' );

            ?>

            <h1 class="h-landmark"><span><?php echo $title; ?></span></h1>

          <?php elseif ( is_tag() || x_is_portfolio_tag() || x_is_product_tag() ) : ?>

            <?php

            $meta  = x_get_taxonomy_meta();
            $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Tag Archive', '__x__' );

            ?>

            <h1 class="h-landmark"><span><?php echo $title ?></span></h1>

          <?php elseif ( is_404() ) : ?>

            <h1 class="h-landmark"><span><?php _e( 'Oops!', '__x__' ); ?></span></h1>

          <?php elseif ( is_year() ) : ?>

            <h1 class="h-landmark"><span><?php _e( 'Post Archive by Year', '__x__' ); ?></span></h1>

          <?php elseif ( is_month() ) : ?>

            <h1 class="h-landmark"><span><?php _e( 'Post Archive by Month', '__x__' ); ?></span></h1>

          <?php elseif ( is_day() ) : ?>

            <h1 class="h-landmark"><span><?php _e( 'Post Archive by Day', '__x__' ); ?></span></h1>

          <?php elseif ( x_is_portfolio() ) : ?>

            <h1 class="h-landmark"><span><?php the_title(); ?></span></h1>


          // =============================================================================
          // Display "Event" in custom post type event archive
          <?php elseif ( is_post_type_archive('event') ) : ?>

            <h1 class="h-landmark"><span>Events</span></h1>

          // =============================================================================

          <?php endif; ?>

          </div>

          <?php if ( $breadcrumbs == '1' ) : ?>
            <?php if ( ! is_front_page() && ! x_is_portfolio() ) : ?>
              <div class="x-breadcrumbs-wrap">
                <?php x_breadcrumbs(); ?>
              </div>
            <?php endif; ?>
          <?php endif; ?>

          <?php if ( x_is_portfolio() ) : ?>
            <div class="x-breadcrumbs-wrap">
              <?php x_portfolio_filters(); ?>
            </div>
          <?php endif; ?>

        </div>
      </div>
    </header>

  <?php endif; ?>
<?php endif; ?>

Hope this helps. Please let us know how it goes.

That’s perfect thanks !

If i click on an event and get to the single event page, it displays The Blog now - that should be changed in single-event.php file ?

Many thanks :slight_smile:

Hi there,

What should appear there? I guess it should be "Events"? If yes, please change this line from the above code

<h1 class="h-landmark"><span><?php echo x_get_option( 'x_renew_blog_title' ); ?></span></h1>

to this

<?php if ( is_singular('event') ) : ?>
<h1 class="h-landmark"><span><?php echo __('Events', '__x__'); ?></span></h1>
<?php else : ?>
<h1 class="h-landmark"><span><?php echo x_get_option( 'x_renew_blog_title' ); ?></span></h1>
<?php endif; ?>

Hope that helps :slight_smile:

You guys are very good, don’t stop the great support :slight_smile:
thanks !

You’re welcome.

Hello.

Is there an update to this as I need to do the same but there is no _landmark-header.php file anymore?

Thanks!

There is no update yet, but you’ll have to do this too if you’re trying to implement this in a custom post type. The landmark will be only applicable for Wordpress and X’s default post types.

You may try the above solution for now.

Thanks!

Hi Rad.

Thanks for your message, but I am not sure I understand you.

The _landmark-header.php file does not exist so what file would I need to edit?

Thanks!

Hi there,

I see, I assume that you’re on Pro theme, this one is only applicable for X theme. There is no update yet for Pro landmark/breadcrumbs but should be included in the next update :slight_smile:

Thanks!

Hi Rad.

The site I am working on is with X Theme not Pro.

Could there be a solution?

Thanks!

Hi there,

There is none yet, the landmark is not yet supported by current Pro version. Please stay tuned to the next updates :slight_smile:

Thanks!