Need to add a custom subtitle to a Blog category page in Renew stack

Website Info:

Part 1
Can you please tell me what code I need (to add to my functions.php page in my child theme) so that I can have a custom subtitle for a specific Blog category page?

NOTE: I’m using the Renew stack

Part 2
I only want this subtitle to show on one specific category page. (NOT ON ALL category pages)
Here is the page I want it on:
https://quantumstrat.com/category/case-examples/

To clarify, I want to add a subtitle under the words Case Examples.

Hello @bperry420,

Thank you for the very detailed post information.

Since you have your child theme active and ready, please follow 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( 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 if ( is_category('case-examples') ) : ?>

            <p class="p-landmark-sub"><span>Insert your category subt title here</span></p>

            <?php endif; ?>


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

Do not forget to change the "Insert your category subt title here" with your own text.

3] Save the file named as _landmark-header.php
4] Upload this file to your server in the child theme’s folder wp-contents/themes/x-child/framework/legacy/cranium/headers/views/renew/

You will need to create the folder path since it does not exist in your child theme yet.

We would loved to know if this has work for you. Thank you.

I created the path you gave me and added your code to a file named _landmark-header.php and put it in the renew folder, but it did nothing.

Question:
Is there supposed to be an underscore in front of the file name? I used an underscore because you had one in your file name.

Hi @bperry420,

Yes, it should have underscore character in front of the file name. And I can’t verify if it’s really added in the correct location with correct file name, it’s not visible from the HTML source code.

I recommend providing your FTP login credentials in the secure note so we could verify if it’s added correctly.

Thanks!

I added my FTP login info in a secure note in this thread. (It’s SFTP using port 22)

Hi,

Gotcha! 2 things why your custom _landmark-header.php is not working, first is because it was messed up (https://prnt.sc/l7reyq) (what text editor did you use? please use one of the text editor that Runel’s suggested above)
I’m referring to this file: /x-child/framework/legacy/cranium/headers/views/renew/_landmark-header.php

Second, which takes me time before I realize/check that you have an existing custom _landmark-header.php in here (/x-child/framework/views/renew), that is why no matter what I did on that first _landmark-header.php is not working. Please edit this file instead, and delete that messed up _landmark-header.php

Hope it helps,
Cheers!

Thank you, it’s working now. see the new subtitle here: https://quantumstrat.com/category/case-examples/

On behalf of my colleague, you’re welcome. Cheers! :slight_smile:

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