Community Forums › Forums › Archived Forums › Design Tips and Tricks › Featured widgets reappearing under footer in Minimum Pro
- This topic has 2 replies, 2 voices, and was last updated 7 years, 9 months ago by jay_in_the_life_.
-
AuthorPosts
-
July 18, 2016 at 10:57 am #189747jay_in_the_life_Participant
Hello,
I am having an issue with the featured widgets in Minimum Pro (the ones that appear right under the site tagline on the homepage).
What happens is that they reappear again right under the copyright area in the footer. I have made a few modifications in the code to add a widget area over top of the background image, and I'm wondering if I might have made a mistake that is causing this. I'm very new to PHP so maybe someone here might notice an issue? I'm not sure it would have anything to do with css customization, so I'll just post the PHP:
functions.php Code:
<?php //* 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) load_child_theme_textdomain( 'minimum', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'minimum' ) ); //* Add Image upload and Color select to WordPress Theme Customizer require_once( get_stylesheet_directory() . '/lib/customize.php' ); //* Child theme (do not remove) define( 'CHILD_THEME_NAME', __( 'Minimum Pro Theme', 'minimum' ) ); define( 'CHILD_THEME_URL', 'http://my.studiopress.com/themes/minimum/' ); define( 'CHILD_THEME_VERSION', '3.2.1' ); //* Add HTML5 markup structure add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) ); //* Add viewport meta tag for mobile browsers add_theme_support( 'genesis-responsive-viewport' ); //* Enqueue scripts add_action( 'wp_enqueue_scripts', 'minimum_enqueue_scripts' ); function minimum_enqueue_scripts() { wp_enqueue_script( 'minimum-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' ); wp_enqueue_style( 'dashicons' ); wp_enqueue_style( 'minimum-google-fonts', '//fonts.googleapis.com/css?family=Roboto:300,400|Roboto+Slab:300,400', array(), CHILD_THEME_VERSION ); } //* Add new image sizes add_image_size( 'portfolio', 540, 340, TRUE ); //* Add support for custom header add_theme_support( 'custom-header', array( 'width' => 320, 'height' => 89, 'header-selector' => '.site-title a', 'header-text' => false ) ); //* Add support for structural wraps add_theme_support( 'genesis-structural-wraps', array( 'header', 'site-tagline', 'nav', 'subnav', 'home-featured', 'site-inner', 'footer-widgets', 'footer', 'home-bkgrd-image-overlay' ) ); //* Unregister layout settings genesis_unregister_layout( 'content-sidebar-sidebar' ); genesis_unregister_layout( 'sidebar-content-sidebar' ); genesis_unregister_layout( 'sidebar-sidebar-content' ); //* Unregister secondary sidebar unregister_sidebar( 'sidebar-alt' ); //* Remove site description remove_action( 'genesis_site_description', 'genesis_seo_site_description' ); //* Rename primary and secondary navigation menus add_theme_support ( 'genesis-menus' , array ( 'primary' => __( 'After Header Menu', 'minimum' ), 'secondary' => __( 'Footer Menu', 'minimum' ) ) ); //* Reposition the primary navigation menu remove_action( 'genesis_after_header', 'genesis_do_nav' ); add_action( 'genesis_after_header', 'genesis_do_nav', 15 ); //* Reposition the secondary navigation menu remove_action( 'genesis_after_header', 'genesis_do_subnav' ); add_action( 'genesis_footer', 'genesis_do_subnav', 7 ); //* Reduce the secondary navigation menu to one level depth add_filter( 'wp_nav_menu_args', 'minimum_secondary_menu_args' ); function minimum_secondary_menu_args( $args ){ if( 'secondary' != $args['theme_location'] ) return $args; $args['depth'] = 1; return $args; } //* Add the site tagline section add_action( 'genesis_after_header', 'minimum_site_tagline' ); function minimum_site_tagline() { printf( '<div %s>', genesis_attr( 'site-tagline' ) ); genesis_structural_wrap( 'site-tagline' ); printf( '<div %s>', genesis_attr( 'site-tagline-left' ) ); printf( '<p %s>%s</p>', genesis_attr( 'site-description' ), esc_html( get_bloginfo( 'description' ) ) ); echo '</div>'; printf( '<div %s>', genesis_attr( 'site-tagline-right' ) ); genesis_widget_area( 'site-tagline-right' ); echo '</div>'; genesis_structural_wrap( 'site-tagline', 'close' ); echo '</div>'; } //* Modify the size of the Gravatar in the author box add_filter( 'genesis_author_box_gravatar_size', 'minimum_author_box_gravatar' ); function minimum_author_box_gravatar( $size ) { return 144; } //* Modify the size of the Gravatar in the entry comments add_filter( 'genesis_comment_list_args', 'minimum_comments_gravatar' ); function minimum_comments_gravatar( $args ) { $args['avatar_size'] = 96; return $args; } //* 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' => 'site-tagline-right', 'name' => __( 'Site Tagline Right', 'minimum' ), 'description' => __( 'This is the site tagline right section.', 'minimum' ), ) ); genesis_register_sidebar( array( 'id' => 'home-featured-1', 'name' => __( 'Home Featured 1', 'minimum' ), 'description' => __( 'This is the home featured 1 section.', 'minimum' ), ) ); genesis_register_sidebar( array( 'id' => 'home-featured-2', 'name' => __( 'Home Featured 2', 'minimum' ), 'description' => __( 'This is the home featured 2 section.', 'minimum' ), ) ); genesis_register_sidebar( array( 'id' => 'home-featured-3', 'name' => __( 'Home Featured 3', 'minimum' ), 'description' => __( 'This is the home featured 3 section.', 'minimum' ), ) ); genesis_register_sidebar( array( 'id' => 'home-featured-4', 'name' => __( 'Home Featured 4', 'minimum' ), 'description' => __( 'This is the home featured 4 section.', 'minimum' ), ) ); genesis_register_sidebar( array( 'id' => 'home-bkgrd-image', 'name' => __( 'Home Backstretch Image Overlay', 'minimum' ), 'description' => __( 'Widgets placed here will appear on top of home background image.', 'minimum' ), ) ); //* Customize the entire footer remove_action( 'genesis_footer', 'genesis_do_footer' ); add_action( 'genesis_footer', 'sp_custom_footer' ); function sp_custom_footer() { ?> <p>© Copyright 2016 <a href="http://www.aqtiv.ca/">Aqtiv Essentials Inc.</a> · All Rights Reserved</p> <?php } add_theme_support( 'genesis-connect-woocommerce' );
and the front-page.php:
<?php //* Enqueue scripts add_action( 'wp_enqueue_scripts', 'minimum_front_page_enqueue_scripts' ); function minimum_front_page_enqueue_scripts() { $image = get_option( 'minimum-backstretch-image', sprintf( '%s/images/bg.jpg', get_stylesheet_directory_uri() ) ); //* Load scripts only if custom backstretch image is being used if ( ! empty( $image ) ) { //* Enqueue Backstretch scripts wp_enqueue_script( 'minimum-backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/backstretch.js', array( 'jquery' ), '1.0.0' ); wp_enqueue_script( 'minimum-backstretch-set', get_bloginfo( 'stylesheet_directory' ).'/js/backstretch-set.js' , array( 'jquery', 'minimum-backstretch' ), '1.0.0' ); wp_localize_script( 'minimum-backstretch-set', 'BackStretchImg', array( 'src' => str_replace( 'http:', '', $image ) ) ); //* Add custom body class add_filter( 'body_class', 'minimum_add_body_class' ); } } //* Minimum custom body class function minimum_add_body_class( $classes ) { $classes[] = 'minimum'; return $classes; } //* Add widget support for homepage if widgets are being used add_action( 'genesis_meta', 'minimum_front_page_genesis_meta' ); function minimum_front_page_genesis_meta() { if ( is_home() ) { //* Remove entry meta in entry footer and Genesis loop remove_action( 'genesis_loop', 'genesis_do_loop' ); //* Add Genesis grid loop add_action( 'genesis_loop', 'minimum_grid_loop_helper' ); //* Remove entry footer functions remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 ); remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 ); //* Force full width content layout add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); } if ( is_active_sidebar( 'home-featured-1' ) || is_active_sidebar( 'home-featured-2' ) || is_active_sidebar( 'home-featured-3' ) || is_active_sidebar( 'home-featured-4' ) ) { //* Add Home featured Widget areas add_action( 'genesis_before_content_sidebar_wrap', 'minimum_home_featured', 15 ); } } //* Add markup for homepage widgets function minimum_home_featured() { printf( '<div %s>', genesis_attr( 'home-featured' ) ); genesis_structural_wrap( 'home-featured' ); genesis_widget_area( 'home-featured-1', array( 'before' => '<div class="home-featured-1 widget-area">', 'after' => '</div>', ) ); genesis_widget_area( 'home-featured-2', array( 'before' => '<div class="home-featured-2 widget-area">', 'after' => '</div>', ) ); genesis_widget_area( 'home-featured-3', array( 'before' => '<div class="home-featured-3 widget-area">', 'after' => '</div>', ) ); genesis_widget_area( 'home-featured-4', array( 'before' => '<div class="home-featured-4 widget-area">', 'after' => '</div>', ) ); genesis_structural_wrap( 'home-featured', 'close' ); echo '</div>'; //* end .home-featured } // Display Home Backstretch Image Overlay widget area below header add_action( 'genesis_after_header', 'sk_home_backgroud_image_overlay', 9 ); function sk_home_backgroud_image_overlay() { genesis_widget_area( 'home-bkgrd-image', array( 'before' => '<div class="home-background-image widget-area"><div class="wrap">', 'after' => '</div></div>', ) ); } //* Genesis grid loop function minimum_grid_loop_helper() { if ( function_exists( 'genesis_grid_loop' ) ) { genesis_grid_loop( array( 'features' => 0, 'feature_image_size' => 0, 'feature_content_limit' => 0, 'grid_image_size' => 0, 'grid_content_limit' => 250, 'more' => __( '[Read more]', 'minimum' ), ) ); } else { genesis_standard_loop(); } } //* Run the Genesis loop genesis(); remove_action( 'genesis_loop', 'genesis_do_loop' ); add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); genesis();
July 18, 2016 at 2:09 pm #189757Victor FontModeratorThe last three lines in front-page shouldn't be there. You're running the Genesis functions, completing the [age, then removing the loop and running the Genesis functions a second time. What are you actually trying to do?
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?July 18, 2016 at 3:35 pm #189763jay_in_the_life_ParticipantVictor,
I removed those three lines and my problem was solved! Thanks so much for taking the time to review the code. I added an overlay widget on the background image and I must have carelessly done something in this instance. I'm new with php...
Kindest regards,
-Jason -
AuthorPosts
- The topic ‘Featured widgets reappearing under footer in Minimum Pro’ is closed to new replies.