Renew stack title & breadcrumbs

Hi,
I’m using Renew stack with WPBakery Page Builder & not Cornerstone presently. I have NextGen Gallery installed & on some pages require page template Blank - Container | Header, Footer instead of Default for the gallery. But I still require the title & breadcrumbs. It appears title & breadcrumbs won’t work beyond the default template.
I came across this old topic at https://theme.co/apex/forums/topic/no-breadcrumbs-renew-stack/ which sounded like a similar situation & copied the code but it didn’t work for me. Is it possible to get an updated version to make this work for page template Blank - Container | Header, Footer or an alternative solution.
Thanks in advance
Regards ,
Denis

Hey Denis,

Thanks for writing in! In the latest release, we have moved the templates in the new location. To update the solution in the other thread, please do the following steps below:
1] Using Notepad or TextEdit or Sublime Text or any text editor, please create a new file in your local machine.
2] Insert the following code into that new file

<?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( 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>

          <?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; ?>

3] Save the file named as _landmark-header.php
4] Upload this file to your server in the child theme’s folder wp-content/themes/x-child/framework/legacy/cranium/headers/views/renew/ or wp-content/themes/pro-child/framework/legacy/cranium/headers/views/renew/ if you are using Pro theme.

You will have to create the folder names since it does not exist yet.

Please let us know how it goes.

Hi,
Thanks for reply. Unfortunately that didn’t work for me. As you outlined I created the folders /legacy/cranium/headers/views/renew/ as these didn’t already exist in the directory wp-content/themes/x-child/framework/. However already existing is wp-content/themes/x-child/framework/views/ which is empty.
Is there something I’m missing?
Thanks again.
Regards,
Denis

Hi there,

It doesn’t matter if the /x-child/framework/views/ is empty.

Did you activate your child theme before testing your changes? You can check our child theme setup guide from here (https://theme.co/apex/forum/t/setup-how-to-setup-child-themes/57).

Thanks!

Hi,
I was already using a child theme for other customisations so yes, that is all set up.

Regards,
Denis

Hi Denis,

Would you mind providing your admin and FTP details in a Secure Note so that we could check it?

Thank you.

Hi Jade,

Just checking you received those admin & FTP details in a secure note. Can’t see any confirmation that it went!
Regards,
Denis

Hi there,

What FTP Encryption should I use? No matter what settings I apply, it doesn’t work, I can’t connect to your site’s FTP.

For the meantime, please change this line from the above code

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

with this

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

Thanks!

Hi Rad,
I swapped out the code as you suggested but then title & breadcrumbs disappeared from any page using the default page template. Also, it didn’t allow title & breadcrumbs for page template Blank - Container | Header, Footer which is what I’m trying to achieve.
I’m trying to figure out FTP issue meantime.
Thanks,
Denis

Hi there,

I could not access the website files using the FTP credentials. Would you please kindly make sure the information is correct? Give us the information like this:

FTP Server Address
FTP Port
FTP Username
FTP Password

Meanwhile, I accessed the admin section of your website and added a Test Page and set it to the blank template. After that, I went to Appearance > Editor and in the functions.php added the PHP code below:

// Shortcode to add breadcrumbs to Header Builder
function my_breadcrumbs( ) {
        $breadcrumbs_on = x_get_option( 'x_breadcrumb_display' );
        if ( $breadcrumbs_on == '1' ) :
                $breadcrumbs = x_breadcrumbs();
        endif;
        return $breadcrumbs;
}
add_shortcode( 'breadcrumbs', 'my_breadcrumbs');

The code is what is suggested in this article: https://xthemetips.com/breadcrumbs-for-x-pro-header-builder/949/

Now if you copy the file below from the theme:

wp-content/themes/x/framework/legacy/cranium/headers/views/renew/wp-header.php

and add it to your Child Theme: (You need to create the necessary folders in the Child Theme)

wp-content/themes/x-child/framework/legacy/cranium/headers/views/renew/wp-header.php

Then you can add the PHP code below to wherever you like on that file:

<?php echo do_shortcode('[breadcrumbs]'); ?>

The code above will show the breadcrumbs.

The method I suggested is different from the previous one and I thought that I give you an alternate solution.

Thank you.

Hi,
Sorry I had to leave this for a while to attend to other stuff!
Meantime, thanks for offering an alternative solution. However, I followed your suggestion as you outlined but this resulted in breadcrumbs also appearing where they already existed on the default page template - so I had two breadcrumb instances on the one page. I have now removed the edited wp-header.php file containing the added PHP code & the folders I created for it, returning things to the original state on the server. I have left the Test Page & the shortcode you added in the functions.php for the meantime while we are still ongoing here.

Just to recap - in NextGen Gallery I have a top level album ‘Galleries’ containing a sub-level of albums which contain various galleries. Currently I have title & breadcrumbs on the sub-level albums & galleries pages which are set to default page template. The main top level galleries page is set to Blank Container | Header, Footer but no title or breadcrumbs appear on that page template as I believe they are disabled for all page templates other than the default page template in Renew Stack.
I am looking to enable the title & breadcrumbs on the Blank Container | Header, Footer page template - same as they appear on the default page template, as I intend to change at least some of the existing galleries pages to Blank Container | Header, Footer page template.

The FTP issue should be sorted out now & I have included details in a secure note.
Thanks again for the help.
Regards,
Denis

Hi there,

I did try to access the FTP again and unfortunately, it is not possible:

Is there a firewall or blocker security measure on your server that might be the cause that we can not access the FTP?

If you are interested in the first solution you will need to change the code of the _landmark-header.php to:

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

          <?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; ?>
```

Thank you.

Hi,
That latest code you gave me has worked a treat! I have the title & breadcrumbs for the pages I require them for in the Galleries & I can now just disable page title in page settings for other pages for example About page where I don’t require title & breadcrumbs.
I can’t figure out what the issue with FTP is, we’ve tested it here & connected ok with the credentials I gave you guys! It must have something to do with the hosting company security so I’ll be contacting them to figure it out.
Meantime, thanks for the help once again.
Regards,
Denis

Hi There,

Let us know once you resolved your FTP issue.

Thanks!

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