Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ndiego/b89e19caa903418810d42c09ea710305 to your computer and use it in GitHub Desktop.
Save ndiego/b89e19caa903418810d42c09ea710305 to your computer and use it in GitHub Desktop.
Blox Tutorial: Adding a banner image to all posts with a page title overlay
/* Edit the block id to match the block you are working on */
#blox_global_95 .blox-caption-container {
display: table; /* Required to vertically center text */
height: 100%; /* Make container cover whole image */
text-align: center; /* Center align the page title */
top: 0; /* Make container cover whole image */
}
#blox_global_95 .blox-caption-wrap {
background: none; /* Remove overlay */
display: table-cell; /* Required to vertically center the page title */
vertical-align: middle; /* Vertically center the header over the image */
}
#blox_global_95 .blox-caption-wrap h1 {
color: #fff;
font-size: 50px;
}
/* Mobile Styles for Default Genesis Theme */
@media only screen and (max-width: 800px) {
#blox_global_95 .blox-image-wrap.blox-image-background {
height: 300px; /* Make image look a little better on mobile */
}
#blox_global_95 .blox-caption-wrap h1 {
font-size: 36px; /* Make page title look a little better on mobile */
}
}
// Remove the title and post info from all posts
// This code needs to be added via the Sandbox Addon or be added directly to your functions.php file
add_action( 'genesis_before', 'blox_remove_post_title' );
function blox_remove_post_title() {
if ( is_singular( 'post' ) ) {
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment