Skip to content

Instantly share code, notes, and snippets.

@topleague
topleague / widget-areas-svg-path-code
Created May 9, 2018 18:00
Create Widget Areas for SVG Path Code
//* Register an After Hero Widget for Front Page
add_action( 'widgets_init', 'genesischild_front_page_widgets' );
function genesischild_front_page_widgets() {
genesis_register_sidebar( array(
'id' => 'after-hero',
'name' => __( 'After Hero', 'genesischild' ),
'description' => __( 'This is the After Hero area', 'genesischild' ),
) );
}
@topleague
topleague / svg-path-code-genesis.txt
Last active December 3, 2019 06:07
SVG Path Code for Genesis
/* CODE FOR AFTER HERO WIDGET AREA */
<div class="after-hero">
<svg width: 100%; height:auto viewbox="0 0 2444 132">
<path fill="#8b46ff" fill-rule="evenodd" d="M1222 0h1222c-444.13 88-852.127 132-1223.993 132C849.253 132 442.585 88.263 0 .789V0h1222z"></path>
</svg>
</div>
/* CODE FOR BEFORE FOOTER WIDGET AREA */
<div class="before-footer-widget">
<svg width: 100%; height:auto viewbox="0 0 2444 132">
@topleague
topleague / css-front-page-widgets-business-theme.css
Last active April 25, 2018 12:00
CSS for Front Page Widgets in Business Theme
/* Change the Position of the Header */
.site-header {
position: inherit;
}
/* Define Width of the Site-inner */
.site-inner, .wrap {
margin: 0 auto;
max-width: 1280px;
}
@topleague
topleague / grid-styles-blog-archives.css
Created April 25, 2018 10:10
Grid Styles in Blog Archives
/* Define Grid Styles in Blog Archives */
.blog .entry, .archive .entry {
background: #fff;
}
.blog .entry-meta, .archive .entry-meta {
margin-bottom: 20px;
font-size: 14px;
font-size: 1.4rem;
@topleague
topleague / relocate-blog-archives.php
Last active December 3, 2019 07:12
Relocating Elements in Gridified Blog Archives in Business Theme
//# Remove and Relocate Featured Image on Blog & Archive Pages
remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
add_action( 'genesis_entry_header', 'genesis_do_post_image', 8 );
// Re-position Category Info on Blog & Archive Pages
add_action('genesis_before_loop','archive_elements_relocation');
function archive_elements_relocation() {
if (is_home() || is_archive() ) {
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
@topleague
topleague / hero-image-entry-title-subtitle-overlay.php
Created April 25, 2018 08:27
Featured Hero Image with Entry Title and Subtitle as Overlay
//* Display Featured Hero Image with Entry Title and Subtitle as Overlay
add_action( 'genesis_after_header', 'page_hero_image' );
function page_hero_image() {
// if we are not on a single Post, abort.
if ( !is_singular( 'post' && 'page' ) || is_front_page()) {
return;
}
// set $image to URL of featured image. If featured image is not present, set it to post-image.jpg in child theme's images directory.
if ( has_post_thumbnail() ) {
@topleague
topleague / excerpt-post-page-front-page.php
Created April 25, 2018 08:12
Display Excerpt as Subtitle in Post/Page Except Front Page
//* Display Excerpt as Post Subtitle in Genesis
add_action( 'genesis_entry_header', 'content_excerpt', 10 );
function content_excerpt() {
if ( is_singular( 'page' ) | is_singular( 'post' ) && !is_front_page() ) {
printf( '<p class="excerpts">%s</p>', get_the_excerpt() );
}
}
@topleague
topleague / demo-content-front-page-widgets.txt
Created April 25, 2018 02:41
Demo Content for Front Page Widgets in Business Theme
/* DEMO CONTENT FOR HERO WIDGET */
TITLE: Boost Your ROI by 34% with Our Innovative Platform
BODY: <div class="hero-content">
Our AI-driven content marketing platform helps you boost your content marketing performance like never before.
<a class="button" href="https://leaguewp.com/#">Sign up Demo</a>
</div>
@topleague
topleague / display-front-widgets-business-theme.php
Last active April 24, 2018 19:26
Display Front Page Widgets in Business Theme
//* Display Widgets on Front Page
add_action( 'genesis_after_header','genesischild_front_page_one' );
function genesischild_front_page_one() {
if ( is_front_page() )
genesis_widget_area ('featured-background-1', array(
'before' => '<div class="featured-background-1"><div class="wrap">',
'after' => '</div></div>',
) );
}
@topleague
topleague / register-front-widgets-business-theme.php
Last active April 24, 2018 19:21
Register Front Page Widgets in Business Theme
//* Register Widgets for Front Page
add_action( 'widgets_init', 'genesischild_front_page_widgets' );
function genesischild_front_page_widgets() {
genesis_register_sidebar( array(
'id' => 'featured-background-1',
'name' => __( 'Hero', 'genesischild' ),
'description' => __( 'This is the Hero area', 'genesischild' ),
) );