Community Forums › Forums › Archived Forums › Design Tips and Tricks › (Magazine Pro Theme)
Tagged: hooks, Magazine Pro, php
- This topic has 2 replies, 2 voices, and was last updated 8 years, 5 months ago by Saqib Ali.
-
AuthorPosts
-
August 18, 2016 at 4:46 pm #191560Saqib AliMember
I'm developing a site locally (I can provide screenshots if need be).
I'm trying to get the Genesis responsive slider appear full-width across the page but unfortunately the Primary Sidebar widget area is taking up the space along the right hand side.
In the widgets area I placed the slider within Home - Top
I think I've identified the hook which needs to be used for the slider to be placed
genesis_before_content_sidebar_wrap
I have a basic understanding of PHP but appreciate to learn how I'd hook the slider into
genesis_before_content_sidebar_wrap
August 19, 2016 at 6:42 am #191595Victor FontModeratorThe Magazine Pro home-top widget area is loaded into the Genesis loop in front-page.php. Using the genesis_before_content_sidebar_wrap hook as you want to won't work because the home-top widget area is loaded with home-middle and home-bottom within the same magazine_homepage_widgets function. You need to rewrite portions of front-page.php to separate home-top out from the pack. Since you only have a basic understanding of PHP, the following code should help you. This is the front-page.php file recoded so the slider goes after the header.
<?php /** * This file adds the Home Page to the Magazine Pro Child Theme. * * @author StudioPress * @package Magazine Pro * @subpackage Customizations */ add_action( 'genesis_meta', 'magazine_home_genesis_meta' ); /** * Add widget support for homepage. If no widgets active, display the default loop. * */ function magazine_home_genesis_meta() { if ( is_active_sidebar( 'home-top' ) || is_active_sidebar( 'home-middle' ) || is_active_sidebar( 'home-bottom' ) ) { // Force content-sidebar layout setting add_filter( 'genesis_site_layout', '__genesis_return_content_sidebar' ); // Add magazine-home body class add_filter( 'body_class', 'magazine_body_class' ); if ( is_active_sidebar( 'home-top' ) ) { add_action('genesis_after_header', 'magazine_hometop_widget' ); } // Remove the default Genesis loop remove_action( 'genesis_loop', 'genesis_do_loop' ); // Add homepage widgets add_action( 'genesis_loop', 'magazine_homepage_widgets' ); } } function magazine_body_class( $classes ) { $classes[] = 'magazine-home'; return $classes; } function magazine_hometop_widget() { genesis_widget_area( 'home-top', array( 'before' => '<div class="home-top widget-area">', 'after' => '</div>', ) ); } function magazine_homepage_widgets() { genesis_widget_area( 'home-middle', array( 'before' => '<div class="home-middle widget-area">', 'after' => '</div>', ) ); genesis_widget_area( 'home-bottom', array( 'before' => '<div class="home-bottom widget-area">', 'after' => '</div>', ) ); } genesis();
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?August 21, 2016 at 9:53 am #191720Saqib AliMemberReally appreciate the help Victor, I just need to adjust the sizing of the pictures and slider.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.