Blog Page Title Question

I don’t fully understand this solution. So because I’m using a Pro Header I can’t have blog titles?

Hi Mary,

You can have the page title on the Pro Header, but it involves duplicating your header, adding the page title manually on a new bar, and assigning it to the blog page.

Whereas, if you follow Ruenel’s suggestions above, your pages will output a landmark area (below header) that displays the page title dynamically.

Cheers!

So I add this shortcode: [awesome_landmark] in another bar in my menu, but I’m unclear as to where to add this code?:

**Also, now there is an extra bar visible on my header, and the shortcode is visible: https://sandbox.zivelo.com/

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_single() ) : ?>

<?php the_title(); ?>

<?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 Mary,

You may add the code in the functions.php file of the child theme.

https://theme.co/apex/child-themes

Hope this helps.

This question from above wasn’t answered. How can I get my menu to look as it should? And, that bar interfere’s with my menu drop downs.

And I received this error when I input the code. How else can I achieve this?

Hey Mary,

​To assist you better with this issue, would you mind providing us the url of your site with login credentials so we can take a closer look? This is to ensure that we can provide you with a tailored answer to your situation.

To do this, you can create a secure note with the following info:
– Link to your site
– WordPress Admin username / password

To know how to create a secure note, please check this out: https://theme.co/apex/forum/t/how-to-get-support/288

Thank you.

Here you go

Hello Mary,

I can confirmed that you cannot add any custom functions in your child theme’s functions.php file via the editor. You will have to edit the file manually. Please log in to your ftp, download the file in wp-content/themes/x-child/functions.php and insert the code manually.

To know where to get your ftp access, you can check out this documentation:
https://docs.webfaction.com/user-guide/access.html?highlight=ftp#connecting-with-ftp

I don’t know how to do that. Is this something I can get assistance with, as it’s an issue related to the header?

Please see above, these issues were also not addressed.

Hello Mary,

The code is now added to your child theme’s functions.php file. You can now use the [awesome_landmark] shortcode.

The bar 3 should have a smaller z-index number compared to your bar 1 which is the container of the menu so that the bar 3 will not interfere with your menu. The menu should be on top of other elements. The bar 1 should have z-index of 9999 and the bar 3 must only have a z-index of 9998 or less.

Hope this helps.

I appreciate your help, but I’m not seeing a blog title page. I want title pages here: http://sandbox.zivelo.com/blog/ and here: https://sandbox.zivelo.com/category/news/ but there are still no titles. I also changed the z-index to 9990 and placed that bar on top, but now you can see that bar on top (until scroll). How can I make hide it and display page titles?

Hello Mary,

The landmark is working fine. It is know showing at the moment because you have added this css code somewhere in your custom css section:

.x-header-landmark {
    display: none;
}

Please remove the css block and the landmark should display.

Please position the bar as relative and make sure that it will be located as the last bar order so that it appears last and as soon as you scroll the page, the bar will just scroll like the page contents.

Hope this helps.

Hello, now it’s looking better, but why is there a “Welcome” headline under where it says “Blog” http://sandbox.zivelo.com/blog/

And on post pages, like this, there are 2 headlines: https://sandbox.zivelo.com/devathon-an-interview-with-entrepreneur-healey-cypher/
Is there a way to disable the lower headline?

On category pages, the headline is Category Archive: https://sandbox.zivelo.com/category/news/
Is there a way to edit it to be more specific, where it says “News”?

Hi There,

Please update the code to this:


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>
  </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();

}

Please add this custom CSS under Theme Options > CSS:

.single-post .entry-header {
    display: none;
}

That’s the archive title option. You can add the Archive Title when you edit a category:

Hope it helps :slight_smile:

In terms of updating the PHP code, I had to get your team’s help with that because I was unable to add the code in wordpress. So could you help me with updating that? I will add the CSS and adjust the settings.

Hi There,

I’ve updated the code for you.

The Welcome text has been removed.

Regards!

Thank you!

You’re most welcome.

Why have you made this so complicated? Why do you not support that ability to enter a title for the blog in the blog customize area? The suggested solution is not clear and sounds complex when all I want to do is have a custom header and a title on my blog.