• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

(Magazine Pro Theme)

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › (Magazine Pro Theme)

This topic is: resolved

Tagged: hooks, Magazine Pro, php

  • This topic has 2 replies, 2 voices, and was last updated 7 years, 1 month ago by Saqib Ali.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • August 18, 2016 at 4:46 pm #191560
    Saqib Ali
    Member

    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 #191595
    Victor Font
    Moderator

    The 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 #191720
    Saqib Ali
    Member

    Really appreciate the help Victor, I just need to adjust the sizing of the pictures and slider.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble