Community Forums › Forums › Archived Forums › Design Tips and Tricks › Create 4 Column Widget Area After Footer In Genisis Life style Pro
- This topic has 4 replies, 2 voices, and was last updated 8 years ago by
TonySan1.
-
AuthorPosts
-
June 6, 2018 at 4:36 pm #220618
TonySan1
MemberHi good people you guys have been so very helpful and I thank you. Can someone tell me what code is needed to create a 4 column widget area in the after footer hook in the Genesis lifestyle pro theme. My Functions php code for my site looks like this:
"<?php
/**
* Lifestyle Pro.
*
* This file adds the functions to the Lifestyle Pro Theme.
*
* @package Lifestyle
* @author StudioPress
* @license GPL-2.0+
* @link http://my.studiopress.com/themes/lifestyle/
*/// Start the engine.
include_once( get_template_directory() . '/lib/init.php' );// Setup Theme.
include_once( get_stylesheet_directory() . '/lib/theme-defaults.php' );// Set Localization (do not remove).
add_action( 'after_setup_theme', 'lifestyle_localization_setup' );
function lifestyle_localization_setup(){
load_child_theme_textdomain( 'lifestyle-pro', get_stylesheet_directory() . '/languages' );
}// Add the theme helper functions.
include_once( get_stylesheet_directory() . '/lib/helper-functions.php' );// Add Color select to WordPress Theme Customizer.
require_once( get_stylesheet_directory() . '/lib/customize.php' );// Include Customizer CSS.
include_once( get_stylesheet_directory() . '/lib/output.php' );// Add WooCommerce support.
include_once( get_stylesheet_directory() . '/lib/woocommerce/woocommerce-setup.php' );// Add the WooCommerce customizer CSS.
include_once( get_stylesheet_directory() . '/lib/woocommerce/woocommerce-output.php' );// Include notice to install Genesis Connect for WooCommerce.
include_once( get_stylesheet_directory() . '/lib/woocommerce/woocommerce-notice.php' );// Child theme (do not remove).
define( 'CHILD_THEME_NAME', __( 'Lifestyle Pro', 'lifestyle-pro' ) );
define( 'CHILD_THEME_URL', 'http://my.studiopress.com/themes/lifestyle/' );
define( 'CHILD_THEME_VERSION', '3.2.4' );// Add HTML5 markup structure.
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) );// Add Accessibility support.
add_theme_support( 'genesis-accessibility', array( '404-page', 'drop-down-menu', 'headings', 'rems', 'search-form', 'skip-links' ) );// Add viewport meta tag for mobile browsers.
add_theme_support( 'genesis-responsive-viewport' );// Enqueue Scripts.
add_action( 'wp_enqueue_scripts', 'lifestyle_load_scripts' );
function lifestyle_load_scripts() {wp_enqueue_style( 'dashicons' );
wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Droid+Sans:400,700|Roboto+Slab:400,300,700', array(), CHILD_THEME_VERSION );
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
wp_enqueue_script( 'lifestyle-responsive-menu', get_stylesheet_directory_uri() . '/js/responsive-menus' . $suffix . '.js', array( 'jquery' ), CHILD_THEME_VERSION, true );
wp_localize_script(
'lifestyle-responsive-menu',
'genesis_responsive_menu',
lifestyle_responsive_menu_settings()
);}
// Define our responsive menu settings.
function lifestyle_responsive_menu_settings() {$settings = array(
'mainMenu' => __( 'Menu', 'lifestyle-pro' ),
'subMenu' => __( 'Submenu', 'lifestyle-pro' ),
'menuClasses' => array(
'combine' => array(
'.nav-primary',
'.nav-header',
'.nav-secondary',
),
),
);return $settings;
}
// Add image sizes.
add_image_size( 'home-large', 634, 360, TRUE );
add_image_size( 'home-small', 266, 160, TRUE );// Add support for custom background.
add_theme_support( 'custom-background', array(
'default-image' => get_stylesheet_directory_uri() . '/images/bg.png',
'default-color' => 'efefe9',
) );// Add support for custom header.
add_theme_support( 'custom-header', array(
'flex-height' => true,
'header_image' => '',
'header-selector' => '.site-title a',
'header-text' => false,
'height' => 220,
'width' => 640,
) );// Rename menus.
add_theme_support( 'genesis-menus', array( 'primary' => __( 'Before Header Menu', 'lifestyle-pro' ), 'secondary' => __( 'After Header Menu', 'lifestyle-pro' ) ) );// Remove output of primary navigation right extras.
remove_filter( 'genesis_nav_items', 'genesis_nav_right', 10, 2 );
remove_filter( 'wp_nav_menu_items', 'genesis_nav_right', 10, 2 );// Remove navigation meta box.
add_action( 'genesis_theme_settings_metaboxes', 'lifestyle_remove_genesis_metaboxes' );
function lifestyle_remove_genesis_metaboxes( $_genesis_theme_settings_pagehook ) {
remove_meta_box( 'genesis-theme-settings-nav', $_genesis_theme_settings_pagehook, 'main' );
}// Add ID to secondary navigation.
add_filter( 'genesis_attr_nav-secondary', 'lifestyle_add_nav_secondary_id' );
function lifestyle_add_nav_secondary_id( $attributes ) {$attributes['id'] = 'genesis-nav-secondary';
return $attributes;
}
// Remove skip link for primary navigation.
add_filter( 'genesis_skip_links_output', 'lifestyle_skip_links_output' );
function lifestyle_skip_links_output( $links ) {if ( isset( $links['genesis-nav-primary'] ) ) {
unset( $links['genesis-nav-primary'] );
}$new_links = $links;
array_splice( $new_links, 0 );if ( has_nav_menu( 'secondary' ) ) {
$new_links['genesis-nav-secondary'] = __( 'Skip to secondary menu', 'lifestyle-pro' );
}return array_merge( $new_links, $links );
}
// Open wrap within site-container.
add_action( 'genesis_before_header', 'lifestyle_open_site_container_wrap' );
function lifestyle_open_site_container_wrap() {echo '<div class="site-container-wrap">';
}
// Reposition the primary navigation.
remove_action( 'genesis_after_header', 'genesis_do_nav' );
add_action( 'genesis_before_header', 'genesis_do_nav' );// Modify the size of the Gravatar in the author box.
add_filter( 'genesis_author_box_gravatar_size', 'lifestyle_author_box_gravatar' );
function lifestyle_author_box_gravatar( $size ) {
return 96;
}// Modify the size of the Gravatar in the entry comments.
add_filter( 'genesis_comment_list_args', 'lifestyle_comments_gravatar' );
function lifestyle_comments_gravatar( $args ) {$args['avatar_size'] = 60;
return $args;
}
// Close wrap within site-container.
add_action( 'genesis_after_footer', 'lifestyle_close_site_container_wrap' );
function lifestyle_close_site_container_wrap() {
echo '</div>';
}// Add support for 3-column footer widgets.
add_theme_support( 'genesis-footer-widgets', 3 );// Add support for after entry widget.
add_theme_support( 'genesis-after-entry-widget-area' );// Relocate after entry widget.
remove_action( 'genesis_after_entry', 'genesis_after_entry_widget_area' );
add_action( 'genesis_after_entry', 'genesis_after_entry_widget_area', 5 );// Register widget areas.
genesis_register_sidebar( array(
'id' => 'home-top',
'name' => __( 'Home - Top', 'lifestyle-pro' ),
'description' => __( 'This is the top section of the homepage.', 'lifestyle-pro' ),
) );
genesis_register_sidebar( array(
'id' => 'home-middle',
'name' => __( 'Home - Middle', 'lifestyle-pro' ),
'description' => __( 'This is the middle section of the homepage.', 'lifestyle-pro' ),
) );
genesis_register_sidebar( array(
'id' => 'home-bottom-left',
'name' => __( 'Home - Bottom Left', 'lifestyle-pro' ),
'description' => __( 'This is the bottom left section of the homepage.', 'lifestyle-pro' ),
) );
genesis_register_sidebar( array(
'id' => 'home-bottom-right',
'name' => __( 'Home - Bottom Right', 'lifestyle-pro' ),
'description' => __( 'This is the bottom right section of the homepage.', 'lifestyle-pro' ),
) );
genesis_register_sidebar( array(
'id' => 'before-footer',
'name' => __( 'Before Footer' ),
) );genesis_after_footer"
http://diyinternetmarketer.com
Can you help?June 7, 2018 at 3:43 pm #220643Terry
MemberOn or around line 190 you'll find the code that sets the number of footer widgets to 3. You can change that to 4.
There will also probably be some changes to your css when you change from 3 to 4 widgets.
Hope that helps.
June 7, 2018 at 5:36 pm #220648TonySan1
MemberHi Terry, thank you for your help. But what I'm looking for is to add an additional footer widget area after the main footer. I need that after footer widget area to contain 4 columns. So I want to keep the 3 column footer widget area as well as add a new 4 column widget area. Can anyone help me with the code to create the widget area?
June 7, 2018 at 6:12 pm #220649June 7, 2018 at 7:59 pm #220654TonySan1
MemberThanks again Terry for your help. The code for that widget will not help me.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.