Last active
October 21, 2019 03:28
-
-
Save topleague/2b3a9fa18afbf815379057bc1f157c1f to your computer and use it in GitHub Desktop.
Full Width Hero Background with ParticleJS Pattern on Front Page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* 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