Skip to content

Instantly share code, notes, and snippets.

@MaruscaGabriel
Created January 26, 2015 19:12
Show Gist options
  • Save MaruscaGabriel/93795004cd26384d5aaa to your computer and use it in GitHub Desktop.
Save MaruscaGabriel/93795004cd26384d5aaa to your computer and use it in GitHub Desktop.
Relocate titles under Header on page, post and other single pages
<?php
add_action( 'genesis_after_header','relocate_entry_title_singular' );
function relocate_entry_title_singular() {
if ( ! is_singular() )
return;
echo '<div class="entry-header-wrapper"><div class="wrap">';
genesis_do_post_title();
echo '</div></div>';
if ( is_page_template( 'page_blog.php' ) )
return;
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
if ( ! is_singular('post' ) )
return;
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
}
.entry-header-wrapper {
margin-top: 0px;
padding: 30px 0;
background-color: #4D62B6;
text-align: center;
}
.entry-header-wrapper .entry-title {
margin-bottom: 0;
}
.page .entry-header-wrapper + .site-inner, .single .entry-header-wrapper + .site-inner,
.archive .entry-header-wrapper + .site-inner {
margin-top: 0px;
}
.entry-header-wrapper .archive-description {
margin-bottom: 0;
}
.entry-header-wrapper, .entry-header-wrapper h1 {
color: #fff;
}
.entry-header-wrapper a {
color: #000;
}
@media only screen and (max-width: 1200px) {
.entry-header-wrapper {
margin-top: 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment