Skip to content

Instantly share code, notes, and snippets.

@topleague
Last active October 21, 2019 03:28
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 topleague/2b3a9fa18afbf815379057bc1f157c1f to your computer and use it in GitHub Desktop.
Save topleague/2b3a9fa18afbf815379057bc1f157c1f to your computer and use it in GitHub Desktop.
Full Width Hero Background with ParticleJS Pattern on Front Page
//* Full Width Hero Background with ParticleJS Pattern on Front Page
//* Add Excerpt support to Pages in Genesis (Optional)
add_post_type_support( 'page', 'excerpt' );
//* Display Page Title and Page Excerpt (as Subtitle) after Header
add_action( 'genesis_header', 'blog_archive_remove_page_title');
function blog_archive_remove_page_title () {
if (is_front_page()) {
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
add_action( 'genesis_after_header', 'blog_archive_after_header_content' );
function blog_archive_after_header_content() {
?>
<div class="post-hero" style="background-color:#da2020">
<div id="particlesbg" class="wrap">
<?php echo '<h1 itemprop="headline" class="blog-title">' . genesis_do_post_title() . '</h1>'; ?>
<?php echo '<p class="page-excerpt">' . get_the_excerpt() . '</p>'; ?>
</div>
</div>
<?php
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment