Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions assets/sass/layouts/header/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
margin-bottom: 0;
font-size: 40px;
line-height: 1.5;
color: #27272a;
font-weight: 500;
margin-block-start: 0.67em;
margin-block-end: 0.67em;
margin-inline-start: 0;
margin-inline-end: 0;

a {
color: $color__primary;
Expand Down
11 changes: 6 additions & 5 deletions inc/builder-template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,17 @@ function colormag_get_area_class( $id ) {

if ( ! function_exists( 'colormag_render_header_cols' ) ) {
/**
* @param $cols - array of elements
* @param $cols_area - left, center, right
* @param array $cols Array of elements
* @param string $cols_area Left, center, right
* @param string $device Device type (desktop or mobile)
*
* @return void
*/
function colormag_render_header_cols( $cols, $cols_area ) {
function colormag_render_header_cols( $cols, $cols_area, $device = 'desktop' ) {
echo '<div class="cm-header-' . esc_attr( colormag_get_area_class( $cols_area ) ) . '-col">';
foreach ( $cols as $element ) {
do_action( 'colormag_header_template_parts', $element );
get_template_part( "template-parts/header-builder-elements/$element", '' );
get_template_part( "template-parts/header-builder-elements/$element", '', array( 'device' => $device ) );
}
echo '</div>';
}
Expand Down Expand Up @@ -262,7 +263,7 @@ function colormag_render_header_rows( $builder, $device ) {
echo '<div class="cm-' . esc_attr( colormag_get_area_class( $area ) ) . '-row">';

foreach ( $row as $cols_area => $cols ) {
colormag_render_header_cols( $cols, $cols_area );
colormag_render_header_cols( $cols, $cols_area, $device );
}

echo '</div>';
Expand Down
75 changes: 67 additions & 8 deletions style-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ body {
body #page {
display: flex;
flex-direction: column;
min-height: 96vh;
min-height: calc( 100vh - var(--wp-admin--admin-bar--height, 0px));
}

body .cm-content {
Expand Down Expand Up @@ -1300,17 +1300,70 @@ table td {
font-size: 16px;
}

.cm-header-builder .social-style-1 {
gap: 0px;
.cm-header-builder .social-icons {
display: flex;
align-items: center;
}

.cm-header-builder .social-style-1 a {
border-left: 1px solid #4E4E4E;
padding: 0 10px;
.cm-header-builder .social-icons a {
font-size: 20px;
}

.cm-header-builder .social-icons.social-separator-dot a {
margin-left: 5px;
}

.cm-header-builder .social-icons.social-separator-dot a:after {
content: "•";
margin-right: 10px;
}

.cm-header-builder .social-icons.social-separator-line a:after {
content: "|";
margin-right: 10px;
}

.cm-header-builder .social-icons.social-separator-space a:after {
content: " ";
}

.cm-header-builder .social-icons.social-separator-slash a:after {
content: "/";
margin-right: 10px;
}

.cm-header-builder .social-style-1 a:last-child {
border-left: none;
.cm-header-builder .social-icons.social-separator-pipe a:after {
content: "|";
margin-right: 10px;
}

.cm-header-builder .social-icons.social-separator-bullet a:after {
content: "•";
margin-right: 10px;
}

.cm-header-builder .social-icons.social-separator-hyphen a:after {
content: "-";
margin-right: 10px;
}

.cm-header-builder .social-icons.social-separator-comma a:after {
content: ",";
margin-right: 10px;
}

.cm-header-builder .social-icons.social-separator-chevron a:after {
content: "›";
margin-right: 10px;
}

.cm-header-builder .social-icons.social-separator-arrow a:after {
content: "→";
margin-right: 10px;
}

.cm-header-builder .social-icons a:last-child:after {
content: none;
}

.cm-header-builder.cm-layout-1-transparent {
Expand Down Expand Up @@ -4346,6 +4399,12 @@ Styles for separating single posts loaded from ajax call.
margin-bottom: 0;
font-size: 40px;
line-height: 1.5;
color: #27272a;
font-weight: 500;
margin-block-start: 0.67em;
margin-block-end: 0.67em;
margin-inline-start: 0;
margin-inline-end: 0;
}

.cm-site-title a {
Expand Down
75 changes: 67 additions & 8 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ body {
body #page {
display: flex;
flex-direction: column;
min-height: 96vh;
min-height: calc( 100vh - var(--wp-admin--admin-bar--height, 0px));
}

body .cm-content {
Expand Down Expand Up @@ -1300,17 +1300,70 @@ table td {
font-size: 16px;
}

.cm-header-builder .social-style-1 {
gap: 0px;
.cm-header-builder .social-icons {
display: flex;
align-items: center;
}

.cm-header-builder .social-style-1 a {
border-right: 1px solid #4E4E4E;
padding: 0 10px;
.cm-header-builder .social-icons a {
font-size: 20px;
}

.cm-header-builder .social-icons.social-separator-dot a {
margin-right: 5px;
}

.cm-header-builder .social-icons.social-separator-dot a:after {
content: "•";
margin-left: 10px;
}

.cm-header-builder .social-icons.social-separator-line a:after {
content: "|";
margin-left: 10px;
}

.cm-header-builder .social-icons.social-separator-space a:after {
content: " ";
}

.cm-header-builder .social-icons.social-separator-slash a:after {
content: "/";
margin-left: 10px;
}

.cm-header-builder .social-style-1 a:last-child {
border-right: none;
.cm-header-builder .social-icons.social-separator-pipe a:after {
content: "|";
margin-left: 10px;
}

.cm-header-builder .social-icons.social-separator-bullet a:after {
content: "•";
margin-left: 10px;
}

.cm-header-builder .social-icons.social-separator-hyphen a:after {
content: "-";
margin-left: 10px;
}

.cm-header-builder .social-icons.social-separator-comma a:after {
content: ",";
margin-left: 10px;
}

.cm-header-builder .social-icons.social-separator-chevron a:after {
content: "›";
margin-left: 10px;
}

.cm-header-builder .social-icons.social-separator-arrow a:after {
content: "→";
margin-left: 10px;
}

.cm-header-builder .social-icons a:last-child:after {
content: none;
}

.cm-header-builder.cm-layout-1-transparent {
Expand Down Expand Up @@ -4346,6 +4399,12 @@ Styles for separating single posts loaded from ajax call.
margin-bottom: 0;
font-size: 40px;
line-height: 1.5;
color: #27272a;
font-weight: 500;
margin-block-start: 0.67em;
margin-block-end: 0.67em;
margin-inline-start: 0;
margin-inline-end: 0;
}

.cm-site-title a {
Expand Down
24 changes: 15 additions & 9 deletions template-parts/header-builder-elements/logo.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;


$screen_reader = '';
$description = get_bloginfo( 'description', 'display' );
$header_display_type = get_theme_mod( 'colormag_header_logo_placement', 'header_text_only' );
$site_identity_enable = get_theme_mod( 'colormag_enable_site_identity', true );
$site_tagline_enable = get_theme_mod( 'colormag_enable_site_tagline', true );
$builder_device = $args['device'] ?? 'desktop';
$site_title_visibility = get_theme_mod(
'colormag_header_site_title_visibility',
array(
Expand Down Expand Up @@ -65,17 +67,21 @@
<div id="cm-site-info" class="">
<?php
if ( $site_identity_enable ) {
if ( is_front_page() || is_home() ) :

if ( 'desktop' === $builder_device && ( is_front_page() || is_home() ) ) {
?>
<h1 class="cm-site-title <?php echo esc_attr( implode( ' ', $device_classes ) ); ?> <?php echo esc_attr( false === $site_identity_enable ? $screen_reader : '' ); ?>">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
</h1>
<?php else : ?>
<h3 class="cm-site-title <?php echo esc_attr( implode( ' ', $device_classes ) ); ?> <?php echo esc_attr( false === $site_identity_enable ? $screen_reader : '' ); ?>">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
</h3>
<!-- Desktop: h1 tag -->
<h1 class="cm-site-title cm-site-title-desktop <?php echo esc_attr( implode( ' ', $device_classes ) ); ?> <?php echo esc_attr( false === $site_identity_enable ? $screen_reader : '' ); ?>">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
</h1>
<?php } else { ?>
<!-- Mobile: span tag -->
<span class="cm-site-title cm-site-title-mobile <?php echo esc_attr( implode( ' ', $device_classes ) ); ?> <?php echo esc_attr( false === $site_identity_enable ? $screen_reader : '' ); ?>">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
</span>

<?php
endif;
}
}
?>

Expand Down