Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / genesis-search-bar-menu.php
Last active December 3, 2019 07:12
Search Bar in Primary Menu in Genesis
//* REMOVE HEADER RIGHT WIDGET AREA AND SHOW PRIMARY NAV MENU WITH SEARCH BOX
//* Credit: Sridhar Katakam
// Step #1: Remove Header Right widget area.
unregister_sidebar( 'header-right' );
// Step #2: Remove Primary Navigation's structural wrap.
add_theme_support( 'genesis-structural-wraps', array( 'header', 'menu-secondary', 'footer-widgets', 'footer' ) );
// Step #3: Rename primary and secondary navigation menus.
@topleague
topleague / front-page-template.php
Created April 3, 2018 18:25
Create a Front-Page Template
<?php
// Displays header.
get_header();
// Displays Footer.
get_footer();
@topleague
topleague / styles-front-monochrome.css
Last active July 8, 2018 20:06
Styles for Front Page for Monochrome Pro
h1, h2, h3, h4, h5, h6 {
font-family: 'Libre Franklin', sans-serif;
}
.entry-content {
font-family: 'alegreya',sans-serif;
font-size: 22px;
font-size: 2.2rem;
color: #444;
}
@topleague
topleague / register-display-front-widgets.php
Created April 3, 2018 15:25
Register and Display Widgets Only on Front Page
//* 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' => __( 'Front Page One', 'genesischild' ),
'description' => __( 'This is the Front Page One area', 'genesischild' ),
) );
genesis_register_sidebar( array(
@topleague
topleague / background-image-output.php
Last active April 3, 2018 15:27
Display Background Images to Widget Areas (Code for Output.php)
add_action( 'wp_enqueue_scripts', 'genesischild_css' );
function genesischild_css() {
wp_enqueue_style( 'genesischild', get_stylesheet_directory_uri() . '/style.css' );
$handle = defined( 'CHILD_THEME_NAME' ) && CHILD_THEME_NAME ? sanitize_title_with_dashes( CHILD_THEME_NAME ) : 'child-theme';
$opts = apply_filters( 'genesischild_images', array( '1', '2', '3', '4' ) );
$settings = array();
foreach( $opts as $opt ){
@topleague
topleague / background-image-customize.php
Last active April 3, 2018 15:28
Add Background Images to Widget Areas (Code for Customize.php)
/* Add Background Images Via the Customizer */
add_action( 'customize_register', 'genesischild_customizer_register' );
function genesischild_customizer_register() {
/* Customize Background Image Control Class */
class Child_Genesischild_Image_Control extends WP_Customize_Image_Control {
/* Constructor. If $args['settings'] is not defined, use the $id as the setting ID */
@topleague
topleague / full-width-entry-header-posts-pages.php
Created April 2, 2018 06:42
Move Entry Header to a Full-width Hook only on Posts/Pages
// Move Entry Header to a Full-width Hook only on Posts/Pages
add_action( 'genesis_after_header', 'leaguewp_full_width_hook', 9 );
function leaguewp_full_width_hook() {
if ( is_singular('post' ) || is_singular('page' ) ) {
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_post_info', 12 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
@topleague
topleague / css-google-custom-search.txt
Created March 4, 2018 11:19
CSS for Google Custom Search Engine In Genesis
/* SEARCH WIDGET */
.nav-primary .search-form input[type="submit"] {
background-color: orange;
border: none;
box-shadow: none;
color: #fff;
cursor: pointer;
padding: 16px 24px;
padding: 1.6rem 2.4rem;
text-transform: uppercase;