Hi,
I want to add category description on Integrity stack.
I found a code snippet, but it does output the string on the upper end of the archive page.
I think it is because there is no header landmark.
Do you have a solution for this?
Thank you!
function add_category_description() {
if(is_archive()) { ?>
Hi There @salilou
Thanks for writing in! Please try following this post (https://theme.co/apex/forum/t/showing-description-in-category-pages-in-ethos/26987/4?u=mldarshana) and implement it accordingly to enable category description on Ethos stack.
Hope that helps.
Thank you.
I did this but on the MEC category pages still the landmark_header ist not inserted.
Maybe I have to add a condition to the code like is_mec().
Is there a way?
The next question will be how to deactivate the h1 therefore it is not doubled with the landmark header.
Hi @salilou,
Please remove the codes you have added then add this in your child theme’s functions.php file.
function add_category_description() {
if(is_tax('mec_category')) {
?>
<header class="x-header-landmark x-container max width">
<h1 class="h-landmark"><span>Mec Category Archive</span></h1>
<p class="p-landmark-sub"><span>Mec Category Description</span></p>
</header>
<?php
}
}
add_action( 'x_after_view_global__slider-below', 'add_category_description',99999 );
Then to remove h1 from landmark, create file _landmark-header.php in wp-content\themes\x-child\framework\legacy\cranium\headers\views\integrity and add the code below into that file.
<?php
// =============================================================================
// VIEWS/INTEGRITY/_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 );
$disable_filters = get_post_meta( get_the_ID(), '_x_portfolio_disable_filtering', true );
if(is_post_type_archive('mec')) {
echo "asdsadasdasdasda";
}
?>
<?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_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>“'; the_search_query(); echo '”</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>“' . single_cat_title( '', false ) . '”</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>“' . single_cat_title( '', false ) . '”</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>“' . single_tag_title( '', false ) . '”</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>“' . single_tag_title( '', false ) . '”</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; ?>
In that code, change all h1 to h2 or to any heading tag you like.
Hope this helps
Thank you. The first worked perfectly!
The second you got me missed.
The h1 is doubled now. I wand to hide the second h1, please see secure link.
The word “Reisen” shall not appear twice.
Hi @salilou,
To remove the other title, create file taxonomy-mec-category.php in wp-content\themes\x-child and copy the code below into that file.
<?php
/** no direct access **/
defined('MECEXEC') or die();
/**
* The Template for displaying mec-category taxonomy events
*
* @author Webnus <info@webnus.biz>
* @package MEC/Templates
* @version 1.0.0
*/
get_header('mec'); ?>
<?php do_action('mec_before_main_content'); ?>
<section id="<?php echo apply_filters('mec_category_page_html_id', 'main-content'); ?>" class="<?php echo apply_filters('mec_category_page_html_class', 'container'); ?>">
<?php if(have_posts()): ?>
<?php do_action('mec_before_events_loop'); ?>
<?php $MEC = MEC::instance(); echo $MEC->category(); ?>
<?php do_action('mec_after_events_loop'); ?>
<?php endif; ?>
</section>
<?php do_action('mec_after_main_content'); ?>
<?php get_footer('mec');
Hope that helps
You are great!
Ah, the headlines get a little bit cut.
You can see it at the point of the letter “i” in the word “Reisen”.
I tried to correct css overflow, but this ended in a visible scrollbar…
Hi @salilou,
To fix it, you can add this in Theme Options > CSS
.tax-mec_category .h-landmark {
line-height: 90px;
}
Perfect! 
If you need anything else we can help you with, don’t hesitate to open another thread.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.