Skip to content

Instantly share code, notes, and snippets.

@topleague
topleague / menu-search-bar-genesis-v2.6.0.css
Last active August 16, 2019 14:13
Search Bar in Primary Menu in Genesis Version: 2.6.0
/* Optimize Search Bar in Primary Menu */
[type=search] {
width: auto;
}
input[type="submit"] {
font-size: 19px;
}
@topleague
topleague / font-page.php
Created April 24, 2018 18:37
Front Page Code in Genesis Business Theme
<?php
// Displays header.
get_header();
// Displays Footer.
get_footer();
@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' ),
) );
@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 / 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 / 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 / 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 / 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 / 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 / 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;
}