Landmark header help with Pro

Hi I had originally asked for help with getting the landmark headers to work on pages such as shop, cart, blog and portfolio that disappear when you set up Pro and I was referred to the post that has the short code and custom code in the child theme functions.php and it didn’t work right at all. I couldn’t get the titles to line up right and on mobile it was styled weird and showed up half way down the page when I inserted the shortcode onto the global header. I was wondering if this could be because the following code they have is for Integrity and I have Renew. Could you have a look this is the code they say to add to the functions.php (see below) because I see it mentions integrity. Would you tell me the correct code to make the landmarks show up on those pages that is for Renew and how to make it show up like it use to. Thanks

add_shortcode(‘awesome_landmark’,‘awesome_landmark’);

function awesome_landmark ( $atts ) {

ob_start();

$disable_page_title = get_post_meta( get_the_ID(), ‘_x_entry_disable_page_title’, true );
$disable_filters = get_post_meta( get_the_ID(), ‘_x_portfolio_disable_filtering’, true );

?>

<?php if ( is_home() && x_get_option( 'x_integrity_blog_header_enable' ) == '1' ) : ?>

<?php echo x_get_option( 'x_integrity_blog_title' ); ?>

<?php echo x_get_option( 'x_integrity_blog_subtitle' ); ?>

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

<?php _e( 'Search Results', '__x__' ); ?>

<?php _e( "Below you'll see everything we could locate for your search of ", '__x__' ); echo '“'; the_search_query(); echo '”'; ?>

<?php elseif ( is_category() || x_is_portfolio_category() ) : ?> <?php $meta = x_get_taxonomy_meta(); $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Category Archive', '__x__' ); $subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all posts that have been categorized as ", '__x__' ) . '“' . single_cat_title( '', false ) . '”'; ?>

<?php echo $title ?>

<?php echo $subtitle ?>

<?php elseif ( x_is_product_category() ) : ?> <?php $meta = x_get_taxonomy_meta(); $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Category Archive', '__x__' ); $subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all items that have been categorized as ", '__x__' ) . '“' . single_cat_title( '', false ) . '”'; ?>

<?php echo $title ?>

<?php echo $subtitle ?>

<?php elseif ( is_tag() || x_is_portfolio_tag() ) : ?> <?php $meta = x_get_taxonomy_meta(); $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Tag Archive', '__x__' ); $subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all posts that have been tagged as ", '__x__' ) . '“' . single_tag_title( '', false ) . '”'; ?>

<?php echo $title; ?>

<?php echo $subtitle; ?>

<?php elseif ( x_is_product_tag() ) : ?> <?php $meta = x_get_taxonomy_meta(); $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Tag Archive', '__x__' ); $subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all items that have been tagged as ", '__x__' ) . '“' . single_tag_title( '', false ) . '”'; ?>

<?php echo $title; ?>

<?php echo $subtitle; ?>

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

<?php _e( 'Oops!', '__x__' ); ?>

<?php _e( "You blew up the Internet. ", '__x__' ); ?>

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

<?php _e( 'Post Archive by Year', '__x__' ); ?>

<?php _e( "Below you'll find a list of all posts from ", '__x__' ); echo ''; echo get_the_date( 'Y' ); echo ''; ?>

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

<?php _e( 'Post Archive by Month', '__x__' ); ?>

<?php _e( "Below you'll find a list of all posts from ", '__x__' ); echo ''; echo get_the_date( 'F, Y' ); echo ''; ?>

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

<?php _e( 'Post Archive by Day', '__x__' ); ?>

<?php _e( "Below you'll find a list of all posts from ", '__x__' ); echo ''; echo get_the_date( 'F j, Y' ); echo ''; ?>

<?php elseif ( x_is_portfolio() ) : ?> <?php if ( $disable_page_title != 'on' || $disable_filters != 'on' ) : ?>
<header class="x-header-landmark x-container max width">
  <?php if ( $disable_page_title != 'on' ) : ?>
    <h1 class="h-landmark"><span><?php the_title(); ?></span></h1>
  <?php endif; ?>
  <?php x_portfolio_filters(); ?>
</header>
<?php endif; ?> <?php elseif ( x_is_shop() && x_get_option( 'x_integrity_shop_header_enable' ) == '1' ) : ?>

<?php echo x_get_option( 'x_integrity_shop_title' ); ?>

<?php echo x_get_option( 'x_integrity_shop_subtitle' ); ?>

<?php elseif ( x_is_buddypress() ) : ?> <?php if ( x_buddypress_is_component_with_landmark_header() ) : ?>
<header class="x-header-landmark x-container max width">
  <h1 class="h-landmark"><span><?php echo x_buddypress_get_the_title(); ?></span></h1>
  <p class="p-landmark-sub"><span><?php echo x_buddypress_get_the_subtitle(); ?></span></p>
</header>
<?php endif; ?> <?php endif; return ob_get_clean(); }

Hi Andrea,

Thank you for writing in, are you using a header that is built in the header builder? The customization in the thread you’ve pointed out is only applicable to the Classic Header. You can add a new bar to your header instead and make that as the landmark bar, you can add a breadcrumbs element on that bar. Or you can follow the guide provided here whichever works for your site.

Cheers!

Thanks but this didn’t help me. I applied the shortcode the post you referred to showed and it doesn’t work it just gives a title of a blog post instead of the title of the page that its on ( shop category page title). I am sure I am not the only person confused as to how to get the page titles back for the shop, shop categories, cart, checkout, portfolio and blogs that disappear when you make a new header in pro. I understand " when you use pro it disables the classic header" but there should be an easier way to get the page titles back on these pages then make 10 different headers manually from the header builder with the specific page titles assigned to each of these pages. On some of the pages there is no way to assign a header and you need to use a global header but the global header has to be dynamic since you don’t want every page to say the same page title if it is a different page. I hope you can understand my frustration. A header builder should be different than a page title since a header can be used on all pages but every page has a different title.

Can you please help me figure out an easier way to get my Shop page title, shop category titles ( which are different for each category) blog, portfolio cart and checkout without making 10 different manual headers which don’t necessarily work for all the pages in there. Thanks

Hello Andrea,

By default, the blog post titles is not included in the landmark header and it is only displayed on the single blog post along with the post items. If you want to display the post tiles, simply update your code and use this instead:

add_shortcode('awesome_landmark','awesome_landmark');

function awesome_landmark ( $atts ) {

ob_start();

$disable_page_title = get_post_meta( get_the_ID(), '_x_entry_disable_page_title', true );
$disable_filters    = get_post_meta( get_the_ID(), '_x_portfolio_disable_filtering', true );

?>

<?php if ( is_home() && x_get_option( 'x_integrity_blog_header_enable' ) == '1' ) : ?>

  <header class="x-header-landmark x-container max width">
    <h1 class="h-landmark"><span><?php echo x_get_option( 'x_integrity_blog_title' ); ?></span></h1>
    <p class="p-landmark-sub"><span><?php echo x_get_option( 'x_integrity_blog_subtitle' ); ?></span></p>
  </header>

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

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

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

  <header class="x-header-landmark x-container max width">
    <h1 class="h-landmark"><span><?php _e( 'Search Results', '__x__' ); ?></span></h1>
    <p class="p-landmark-sub"><span><?php _e( "Below you'll see everything we could locate for your search of ", '__x__' ); echo '<strong>&ldquo;'; the_search_query(); echo '&rdquo;</strong>'; ?></span></p>
  </header>

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

  <?php

  $meta     = x_get_taxonomy_meta();
  $title    = ( $meta['archive-title']    != '' ) ? $meta['archive-title']    : __( 'Category Archive', '__x__' );
  $subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all posts that have been categorized as ", '__x__' ) . '<strong>&ldquo;' . single_cat_title( '', false ) . '&rdquo;</strong>';

  ?>

  <header class="x-header-landmark x-container max width">
    <h1 class="h-landmark"><span><?php echo $title ?></span></h1>
    <p class="p-landmark-sub"><span><?php echo $subtitle ?></span></p>
  </header>

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

  <?php

  $meta     = x_get_taxonomy_meta();
  $title    = ( $meta['archive-title']    != '' ) ? $meta['archive-title']    : __( 'Category Archive', '__x__' );
  $subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all items that have been categorized as ", '__x__' ) . '<strong>&ldquo;' . single_cat_title( '', false ) . '&rdquo;</strong>';

  ?>

  <header class="x-header-landmark x-container max width">
    <h1 class="h-landmark"><span><?php echo $title ?></span></h1>
    <p class="p-landmark-sub"><span><?php echo $subtitle ?></span></p>
  </header>

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

  <?php

  $meta     = x_get_taxonomy_meta();
  $title    = ( $meta['archive-title']    != '' ) ? $meta['archive-title']    : __( 'Tag Archive', '__x__' );
  $subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all posts that have been tagged as ", '__x__' ) . '<strong>&ldquo;' . single_tag_title( '', false ) . '&rdquo;</strong>';

  ?>

  <header class="x-header-landmark x-container max width">
    <h1 class="h-landmark"><span><?php echo $title; ?></span></h1>
    <p class="p-landmark-sub"><span><?php echo $subtitle; ?></span></p>
  </header>

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

  <?php

  $meta     = x_get_taxonomy_meta();
  $title    = ( $meta['archive-title']    != '' ) ? $meta['archive-title']    : __( 'Tag Archive', '__x__' );
  $subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all items that have been tagged as ", '__x__' ) . '<strong>&ldquo;' . single_tag_title( '', false ) . '&rdquo;</strong>';

  ?>

  <header class="x-header-landmark x-container max width">
    <h1 class="h-landmark"><span><?php echo $title; ?></span></h1>
    <p class="p-landmark-sub"><span><?php echo $subtitle; ?></span></p>
  </header>

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

  <header class="x-header-landmark x-container max width">
    <h1 class="h-landmark"><span><?php _e( 'Oops!', '__x__' ); ?></span></h1>
    <p class="p-landmark-sub"><span><?php _e( "You blew up the Internet. ", '__x__' ); ?></span></p>
  </header>

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

  <header class="x-header-landmark x-container max width">
    <h1 class="h-landmark"><span><?php _e( 'Post Archive by Year', '__x__' ); ?></span></h1>
    <p class="p-landmark-sub"><span><?php _e( "Below you'll find a list of all posts from ", '__x__' ); echo '<strong>'; echo get_the_date( 'Y' ); echo '</strong>'; ?></span></p>
  </header>

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

  <header class="x-header-landmark x-container max width">
    <h1 class="h-landmark"><span><?php _e( 'Post Archive by Month', '__x__' ); ?></span></h1>
    <p class="p-landmark-sub"><span><?php _e( "Below you'll find a list of all posts from ", '__x__' ); echo '<strong>'; echo get_the_date( 'F, Y' ); echo '</strong>'; ?></span></p>
  </header>

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

  <header class="x-header-landmark x-container max width">
    <h1 class="h-landmark"><span><?php _e( 'Post Archive by Day', '__x__' ); ?></span></h1>
    <p class="p-landmark-sub"><span><?php _e( "Below you'll find a list of all posts from ", '__x__' ); echo '<strong>'; echo get_the_date( 'F j, Y' ); echo '</strong>'; ?></span></p>
  </header>

<?php elseif ( x_is_portfolio() ) : ?>
  <?php if ( $disable_page_title != 'on' || $disable_filters != 'on' ) : ?>

    <header class="x-header-landmark x-container max width">
      <?php if ( $disable_page_title != 'on' ) : ?>
        <h1 class="h-landmark"><span><?php the_title(); ?></span></h1>
      <?php endif; ?>
      <?php x_portfolio_filters(); ?>
    </header>

  <?php endif; ?>
<?php elseif ( x_is_shop() && x_get_option( 'x_integrity_shop_header_enable' ) == '1' ) : ?>

  <header class="x-header-landmark x-container max width">
    <h1 class="h-landmark"><span><?php echo x_get_option( 'x_integrity_shop_title' ); ?></span></h1>
    <p class="p-landmark-sub"><span><?php echo x_get_option( 'x_integrity_shop_subtitle' ); ?></span></p>
  </header>

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

    <header class="x-header-landmark x-container max width">
      <h1 class="h-landmark"><span><?php echo x_buddypress_get_the_title(); ?></span></h1>
      <p class="p-landmark-sub"><span><?php echo x_buddypress_get_the_subtitle(); ?></span></p>
    </header>

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

return ob_get_clean();

}

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

Will this code you sent work for my woocommerce shop page titles that are missing since I updated to Pro and used a custom header? It seems like this code is for blog post categories? Please let me know if I am misunderstanding? I need my shop page for woocommerce to show category titles on each category because they stopped working when I updated to pro. Thanks

Just to clarify again. My page titles for my shop disappeared when I switched to Pro and made a custom header. What I need is these category titles to come back on the shop pages. Here is a picture example if you go to the page https://www.flashionstatement.com/product-category/male/, which is my Male LED shirt category page, the title has disappeared. See it should look like this

Since the different categories have different titles I need to know how to make sure the correct category title is showing for the right page because I only have one global header I don’t know how to make sure one code makes different category titles show up. Please let me know if you understand and can help. Thanks

Hi Andrea,

Please follow the solution provided by Ruenel, it should work as landmark header as before.
Make sure you add another bar to your header and paste this shortcode [awesome_landmark] to a text element.

The code is dynamic so It should show the correct title of the category pages or posts.

Thanks,

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.