Skip to content

Instantly share code, notes, and snippets.

@rushijagani
Created June 29, 2018 10:18
Show Gist options
  • Save rushijagani/dd3d6cf8e11e4ab8aaf19096ff5c5b57 to your computer and use it in GitHub Desktop.
Save rushijagani/dd3d6cf8e11e4ab8aaf19096ff5c5b57 to your computer and use it in GitHub Desktop.
Display some text when hovered over logo with Astra
<?php
// Add Custom Text with Logo.
add_filter( 'get_custom_logo', 'add_title_markup_with_logo' );
function add_title_markup_with_logo( $output ){
$output .= '<div class="logo-hover-overlay">';
$output .= '<div class="site-title-custom-text">Your Custom Text</div>';
$output .= '</div>';
return $output;
}
@rushijagani
Copy link
Author

Add following CSS to Display some text when hovered over logo with Astra

.ast-site-identity {
    position: relative;
}
.logo-hover-overlay {
  transition: .5s ease;
  opacity: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  text-align: center;
}
.ast-site-identity:hover img {
  opacity: 0.3;
}
.ast-site-identity:hover .logo-hover-overlay {
  opacity: 1;
}
.site-title-custom-text {
  background-color: #9a9a9a;
  color: white;
  font-size: 16px;
  padding: 15px;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment