ETHOS woocommerce categories and archive title

Hi guys,

could you please tell me how to add the woocommerce category title and description or the archive title as well as the blog categories and archive titles (these ones: http://prntscr.com/kelhop )? i know they’re called landmark and they’re removed because of the pro header, but what i can’t find is how to activate it on ETHOS (i found icon and integrity here in the forum),

Hope you can help me out.

Thanks!

Hi @elpanda13,

Thanks for posting in.

The landmark for each stack is different, and in Ethos, there is no description. Still, you can change the archive title on the area in your screenshot.

The file responsible for that is

framework\legacy\cranium\headers\views\ethos\_landmark-header.php

You can copy the file to your child theme of the same path, like

\x-child\framework\legacy\cranium\headers\views\ethos\_landmark-header.php

Then edit it and include your description and text. Example,

<?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__' );

      ?>

      <header class="x-header-landmark x-container max width">
        <h1 class="h-landmark"><span><?php echo $title; ?></span></h1>
        <?php echo term_description() ?>
      </header>

    <?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__' );

      ?>

      <header class="x-header-landmark x-container max width">
        <h1 class="h-landmark"><span><?php echo $title ?></span></h1>
        <?php echo term_description() ?>
      </header>

Thanks!

What about the product titles and descriptions (woocommerce) ?

that code there didn’t show anything, unfortunately :frowning:

Hi,

The code provided by colleague will work if your are not using PRO Header

The landmark is not supported with PRO Header. To add it, you will need a custom code.

You can try this.

Kindly note that this is custom development and may lead to further issues in the theme. It will get complicated which will be difficult to resolve later on. As such, you will need to investigate this particular issue on your own or seek help from a developer should you not feel comfortable making these changes yourself.

Thank you for your understanding.

I’ll give it a try, although i believe i tried that already and didn’t work.

in the meatime could you give me a hand by telling me where can i find the landmarks (specifically category title and description for both woocommerce and blog archives ) in PRO?

Hi There,

The landmark header file locates under pro/framework\legacy\cranium\headers\views\ethos\_landmark-header.php.

  • Take a look at the line from 56 to 67:
<?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__' );

      ?>

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

For more information, please take a look at this:

Hope it helps :slight_smile:

ok, one more question.

Right now, even without the code you provided me (which doesn’t work, unfortunately), the description of the category appears, which is weird because you said it shouldn’t, right?

now, how come does the woocommerce product category descriptions but not the category title?

ifound a solution to this issue, and now i don’t really know why it didn’t work before witht he code you provided me.

here’s the code that worked for me, it’s a bit more simple, because it’s aimed to only show the page title or archive title if present but it can be enhanced with the help of the _landmark-header.php file

/* HEADER LANDMARK IN ETHOS */

function product_header_info(){
	if( x_is_product_category() ){
        $meta  = x_get_taxonomy_meta();
      	$title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Category Archive', '__x__' );
		echo '<header class="x-header-landmark x-container max width">
        		<h1 class="h-landmark"><span>'. $title .'</span></h1>
      		</header>';
	}	
 
}
add_action('woocommerce_archive_description','product_header_info',1);

it’s important to mention that PRO doesn’t seem to be handling the product archive DESCRIPTION (at least not for woocommerce which is the one i’m interested in, right now), so it has to be added before it in the “woocommerce_archive_description” action (that’s why i added the “1” at the end. just to make it show BEFORE the description. )

Hi @elpanda13,

That should work, the code that I provided is for a standard header which was your previous setup.

And @paul.r is correct, when it comes to Pro custom header, you should implement it as shortcode but what I’m not sure is why it’s not working on your end.

The title is part of landmark in Ethos, and since it’s now Pro custom header, the title isn’t going to be displayed either. And your code should work as well similar to shortcode implementation.

Thanks!

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