Skip to content

Commit

Permalink
Show newsletter on splash page (#954)
Browse files Browse the repository at this point in the history
* Show newsletter on splash page

Signed-off-by: Chris Abraham <[email protected]>

* adjust spacing

Signed-off-by: Chris Abraham <[email protected]>

---------

Signed-off-by: Chris Abraham <[email protected]>
  • Loading branch information
cjyabraham authored Dec 23, 2024
1 parent f2f59bc commit dd62d94
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 42 deletions.
69 changes: 28 additions & 41 deletions web/wp-content/themes/lfevents/singular.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,32 @@
$hide_header = get_post_meta( get_the_ID(), 'lfes_hide_header', true );
$hide_sponsors = get_post_meta( get_the_ID(), 'lfes_hide_sponsors', true );
$use_cncf_font = get_post_meta( $parent_id, 'lfes_cncf_font', true );
$event_has_passed = false;
$event_has_passed = get_post_meta( $parent_id, 'lfes_event_has_passed', true );
$menu_color = get_post_meta( $parent_id, 'lfes_menu_color', true );
$menu_color_2 = get_post_meta( $parent_id, 'lfes_menu_color_2', true );
$menu_color_3 = get_post_meta( $parent_id, 'lfes_menu_color_3', true );
$menu_text_color = get_post_meta( $parent_id, 'lfes_menu_text_color', true );
$background_style = 'background-color: ' . $menu_color . ';';
$logo = get_post_meta( $parent_id, 'lfes_' . $menu_text_color . '_logo', true );
$overlay_strength = get_post_meta( $parent_id, 'lfes_overlay_strength', true );

if ( $menu_color_2 ) {
$background_style = 'background: linear-gradient(90deg, ' . $menu_color . ' 0%, ' . $menu_color_2 . ' 100%);';
}
$text_style = 'color: ' . $menu_text_color . ';';

if ( $logo ) {
$event_link_content = '<img loading="lazy" src="' . wp_get_attachment_url( $logo ) . '" alt="' . get_the_title( $parent_id ) . '">';
} else {
$event_link_content = get_the_title( $parent_id );
}

$overlay_style = '';

if ( $overlay_strength || '0' === $overlay_strength ) {
$overlay_strength = (int) $overlay_strength * 0.8 * 0.01;
$overlay_style = 'opacity: ' . $overlay_strength . ';';
}

if ( $use_cncf_font ) {
// Enqueue CNCF font stylesheet.
Expand All @@ -31,43 +56,12 @@
}

if ( ! $splash_page ) {
// menu background color.
$menu_color = get_post_meta( $parent_id, 'lfes_menu_color', true );
$menu_color_2 = get_post_meta( $parent_id, 'lfes_menu_color_2', true );
$menu_color_3 = get_post_meta( $parent_id, 'lfes_menu_color_3', true );
$menu_text_color = get_post_meta( $parent_id, 'lfes_menu_text_color', true );

$background_style = 'background-color: ' . $menu_color . ';';

$event_has_passed = get_post_meta( $parent_id, 'lfes_event_has_passed', true );

if ( $menu_color_2 ) {
$background_style = 'background: linear-gradient(90deg, ' . $menu_color . ' 0%, ' . $menu_color_2 . ' 100%);';
}
$text_style = 'color: ' . $menu_text_color . ';';

$overlay_strength = get_post_meta( $parent_id, 'lfes_overlay_strength', true );

$overlay_style = '';

if ( $overlay_strength || '0' === $overlay_strength ) {
$overlay_strength = (int) $overlay_strength * 0.8 * 0.01;
$overlay_style = 'opacity: ' . $overlay_strength . ';';
}

// set hamburger and list elements color (via class name).
if ( 'white' == $menu_text_color ) {
$subpage_header_elements_class = 'is-white';
} else {
$subpage_header_elements_class = 'is-black';
}

$logo = get_post_meta( $parent_id, 'lfes_' . $menu_text_color . '_logo', true );
if ( $logo ) {
$event_link_content = '<img loading="lazy" src="' . wp_get_attachment_url( $logo ) . '" alt="' . get_the_title( $parent_id ) . '">';
} else {
$event_link_content = get_the_title( $parent_id );
}
?>

<div data-sticky-container class="use-cncf-font">
Expand Down Expand Up @@ -111,7 +105,6 @@ class="event-menu-list <?php echo esc_html( $subpage_header_elements_class ); ?>

</header>
</div>

<?php
} else {
get_template_part( 'template-parts/event-splash-header' );
Expand Down Expand Up @@ -217,11 +210,6 @@ class="icon--inline small-margin-right">
</div>
</div>

<?php
// Only show footer if not a splash screen.
if ( ! $splash_page ) :
?>

<section class="event-footer xlarge-padding-y"
style="background: linear-gradient(90deg, <?php echo esc_html( $menu_color_2 ); ?> 0%, <?php echo esc_html( $menu_color ); ?> 100%); <?php echo esc_html( $text_style ); ?>">

Expand Down Expand Up @@ -275,7 +263,7 @@ class="event-footer-newsletter__title"><?php echo wp_kses( $form_title, array( '

<?php
// Only display this section if there is a logo set.
if ( $logo ) :
if ( $logo && ! $splash_page ) :
?>
<div class="event-footer-alignment">

Expand Down Expand Up @@ -402,10 +390,9 @@ class="event-footer-menu <?php echo esc_html( $menu_text_color ); ?>">
?>
</ul>
<?php
endif;
endif;
?>
</div>
</section>
<?php endif; ?>
<?php
get_footer();
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
}

.event-footer-newsletter {
margin-bottom: 3rem;

.hs-button {
font-weight: 700;
Expand Down Expand Up @@ -246,6 +245,7 @@
}

.event-footer-alignment {
margin-top: 3rem;
max-width: 1100px;

@media (min-width: 1024px) {
Expand Down

0 comments on commit dd62d94

Please sign in to comment.