• 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

Modern Portfolio

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 › General Discussion › Modern Portfolio

This topic is: resolved

Tagged: custom template, modern portfolio

  • This topic has 5 replies, 2 voices, and was last updated 12 years, 8 months ago by SimplyAA.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • October 18, 2013 at 2:17 pm #67424
    SimplyAA
    Member

    I am using the Modern Portfolio theme. I wanted each page to have a unique "About" widget so I created a new widget. For example on this page: http://angelaandrews.me/dolphins/ I am using the dolphin template I created. The widget works great but I now want to display the page content after and can't seem to figure it out.

    I'm sure this is something simple but whatever I try doesn't work. I have this:

    <?php
    /**
     * Controls the dolphin page output.
     */
    
    /*Template Name: Dolphin Page*/
    
    add_action( 'wp_enqueue_scripts', 'mp_enqueue_scripts' );
    /**
     * Enqueue Scripts
     */
    function mp_enqueue_scripts() {
    
    	if ( is_active_sidebar( 'about-dolphins' ) ) {
    		wp_enqueue_script( 'scrollTo', get_stylesheet_directory_uri() . '/js/jquery.scrollTo.min.js', array( 'jquery' ), '1.4.5-beta', true );
    		wp_enqueue_script( 'localScroll', get_stylesheet_directory_uri() . '/js/jquery.localScroll.min.js', array( 'scrollTo' ), '1.2.8b', true );
    		wp_enqueue_script( 'scroll', get_stylesheet_directory_uri() . '/js/scroll.js', array( 'localScroll' ), '', true );
    	}
    }
    
    add_action( 'genesis_meta', 'mp_home_genesis_meta' );
    /**
     * Add widget support for homepage. If no widgets active, display the default loop.
     *
     */
    function mp_home_genesis_meta() {
    
    	if ( is_active_sidebar( 'about-dolphins' )  ) {
    
    		// Force content-sidebar layout setting
    		add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
    
    		// Add mp-home body class
    		add_filter( 'body_class', 'mp_body_class' );
    		function mp_body_class( $classes ) {
    			$classes[] = 'mp-home';
    			return $classes;
    		}
    
    		// Remove the navigation menus
    		remove_action( 'genesis_after_header', 'genesis_do_nav' );
    		remove_action( 'genesis_after_header', 'genesis_do_subnav' );
    
    		// Remove the default Genesis loop
    		remove_action( 'genesis_loop', 'genesis_do_loop' );
    
    		// Add homepage widgets
    		add_action( 'genesis_loop', 'mp_homepage_widgets' );
    
    	}
    
    }
    
    function mp_homepage_widgets() {
    
    	genesis_widget_area( 'about-dolphins', array(
    		'before' => '<div id="about-dolphins"><div class="wrap">',
    		'after' => '</div></div>',
    	) );
    
    }
    
    genesis();
    ?>

    I tried taking out the "remove default genesis loop" section above but all I get is the content of the page, not styled, and no "About" widget.

    Would appreciate any help. Thank you


    Angela

    http://http//www.angelaanadrews.me
    October 19, 2013 at 2:24 am #67597
    Sridhar Katakam
    Participant

    Do you want to add a widget section above content sidebar wrap on static Pages?


    Genesis Tutorials | Follow me on Twitter

    October 19, 2013 at 10:45 am #67677
    SimplyAA
    Member

    If that would be easiest. How can I lit the widget to a specific page?


    Angela

    October 20, 2013 at 8:39 am #67822
    Sridhar Katakam
    Participant

    Add this in functions.php:

    genesis_register_sidebar( array(
    	'id'				=> 'pages_about',
    	'name'			=> __( 'Pages About', 'mp' ),
    	'description'	=> __( 'This is the About section for Pages', 'mp' ),
    ) );
    
    add_action ( 'genesis_before_content_sidebar_wrap', 'sk_pages_about_section' );
    function sk_pages_about_section() {
    
    	if ( is_page() ) {
    
    		genesis_widget_area( 'pages_about', array(
    			'before' => '<div id="pages-about"><div class="wrap">',
    			'after' => '</div></div>',
    		) );
    
    	}
    
    }

    and this in style.css:

    #pages-about {
    	margin-bottom: 3rem;
    	line-height: 1.625;
    }

    Now drag widgets into 'Pages About' sidebar. You can limit what widget appears on what Page using a plugin like Widget Logic.


    Genesis Tutorials | Follow me on Twitter

    October 20, 2013 at 4:22 pm #67903
    SimplyAA
    Member

    I've added a widget (different than above)

    // Register About Page Intro widget
    genesis_register_sidebar( array(
    'id'	=> 'about-intro',
    'name'	=> __( 'About Intro', 'mp' ),
    'description'	=> __( 'This is the intro section of about page.', 'mp' ),
    ) );
     
    // Hook about intro to about page only
    add_action( 'genesis_before_content_sidebar_wrap', 'about_intro', 9 );
    function about_intro() {
    if ( is_page('about-angela') && is_active_sidebar( 'about-intro' ) ) {
    echo '<div class="about-intro"><div class="wrap">';
    dynamic_sidebar( 'about-intro' );
    echo '</div></div>';
    }
    }

    It seems to work okay except it's not going all the way across the page like I want it. It should look like the home page one here: http://angelaandrews.me/. Do you know how I can get to go across full length of the page?


    Angela

    October 20, 2013 at 4:47 pm #67905
    SimplyAA
    Member

    I just figured it out: I needed to change my hook from:

    genesis_before_content_sidebar_wrap

    to:
    genesis_after_header

    Thanks for your help.


    Angela

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Modern Portfolio’ is closed to new replies.

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 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