Skip to content

Instantly share code, notes, and snippets.

@jmabbas
Created January 9, 2026 12:27
Show Gist options
  • Select an option

  • Save jmabbas/92d2130a682f03ffa55f91afb6cb6843 to your computer and use it in GitHub Desktop.

Select an option

Save jmabbas/92d2130a682f03ffa55f91afb6cb6843 to your computer and use it in GitHub Desktop.
Mytravel - category page Category title on h1 tag
function mytravel_output_archive_wrapper() {
$sidebar = mytravel_get_archive_sidebar();
if ( ! class_exists( 'MAS_Travels' ) ) {
if ( is_product() ) {
$full_width_class = ' col-xl-9 mx-auto pb-5 pb-lg-0';
} else {
$full_width_class = ' col-lg-12 col-xl-12 order-1 order-lg-2 pb-5 pb-lg-0';
}
} else {
$full_width_class = ' col-lg-12 col-xl-12 order-1 order-lg-2 pb-5 pb-lg-0';
}
if ( ( is_product() && ! class_exists( 'MAS_Travels' ) ) || ( is_archive() ) ) :
$main_class = 'main';
if ( mytravel_wc_has_sidebar() ) {
$main_class .= ' col-lg-8 col-xl-9 order-1 pb-5 pb-lg-0';
if ( 'left-sidebar' === $sidebar ) {
$main_class .= ' order-lg-2';
} elseif ( 'right-sidebar' === $sidebar ) {
$main_class .= ' order-lg-1';
}
} else {
$main_class .= $full_width_class;
}
$container_class = 'container';
if ( is_shop() || is_product_category() ) {
$container_class .= ' pt-5 pt-xl-8';
}
?><div class="<?php echo esc_attr( $container_class ); ?>">
<div class="row mb-5 mb-lg-8 mt-xl-1">
<div class="<?php echo esc_attr( $main_class ); ?>">
<?php
if ( is_product_category() || is_shop() ) : ?>
<h1 class="woocommerce-products-header__title page-title">
<?php woocommerce_page_title(); ?>
</h1>
<?php endif;
endif;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment