• 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 "About" widget

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 › Modern Portfolio "About" widget

This topic is: resolved

Tagged: widget

  • This topic has 20 replies, 3 voices, and was last updated 11 years, 11 months ago by IamRob.
Viewing 20 posts - 1 through 20 (of 21 total)
1 2 →
  • Author
    Posts
  • July 19, 2013 at 3:18 am #51411
    IamRob
    Member

    Hi all,
    I'd like to add the "about" widget inside the other page of this template. Anyone can help me with it?

    Thank you,
    Rob

    July 19, 2013 at 8:54 am #51433
    Brad Dalton
    Participant

    Please clarify.

    inside the other page of this template

    Do you want to add a widget inside a page you create for your about page rather than the home page?


    Tutorials for StudioPress Themes.

    July 21, 2013 at 4:46 am #51687
    IamRob
    Member

    Exactly! I'd like to have the same widget even inside a page I've created, not only in the home page.

    July 21, 2013 at 11:34 am #51709
    Brad Dalton
    Participant

    Try this: You can change the name of the page slug or use the page i.d rather than the page slug in the code.

    if ( is_page('007') && is_active_sidebar('page-widget' ) ) {
    

    This example uses contact-page in the conditional tag.

    if ( is_page('about-page') && is_active_sidebar( 'page-widget' ) ) {
    

    Please copy this code from the view raw link and paste it at the end of your child themes functions.php file using a text editor like Notepad++.

    https://gist.github.com/braddalton/6049246


    Tutorials for StudioPress Themes.

    July 21, 2013 at 1:00 pm #51717
    IamRob
    Member

    I tried but it doesn't works. The widget doesn't appear inside the page.

    July 21, 2013 at 1:25 pm #51719
    Brad Dalton
    Participant

    You can change the hook.

    Try the genesis_after_post_title hook

    So change this line:

    add_action( 'genesis_before_content_sidebar_wrap', 'wpsites_page_widget', 5 );
    

    To this:

    add_action( 'genesis_after_post_title', 'wpsites_page_widget', 5 );
    

    If you where wanting a widget in the middle of the content area, you would need to use a plugin like, widgets on pages. or shortcode any widget.


    Tutorials for StudioPress Themes.

    July 21, 2013 at 1:39 pm #51722
    IamRob
    Member

    Yes, I did.

    This is the website: http://www.italianluxuryweddings.com/wordpress/

    I'd like to have in every page the same header. The header with the logo and the image is the widget "ABOUT" of the Modern Portfolio Child Theme. I simply putted the logo inside the widget and changed the background of the #about section inside the style.css

    This is the code I added to the function.php page, but it doesn't works.

    genesis_register_sidebar( array(
    'id' => 'page-widget',
    'name' => __( 'Page Widget', 'wpsitesdotnet' ),
    'description' => __( 'Contact page widget.', 'wpsitesdotnet' )
    ) );
    /**
    * @author Brad Dalton - WP Sites
    * @example http://wp.me/p1lTu0-9Jr
    */
    add_action( 'genesis_after_header', 'wpsites_page_widget', 5 );
    function wpsites_page_widget() {
    if ( is_page('about-me') && is_active_sidebar( 'page-widget' ) ) {
    echo '<div class="widget">';
    dynamic_sidebar( 'page-widget' );
    echo '</div><!-- end .page-widget -->';

    }
    }

    July 21, 2013 at 1:46 pm #51724
    ModernMuse
    Member

    Rob,

    What is the page name? That could be the problem. In Brad's example, it's /about-me/.

    Double-check this line in the functions file and edit with your own page name:

    if ( is_page('about-page') && is_active_sidebar( 'page-widget' ) ) {

    @ModernMuseNV | Portfolio | Personal Blog

    July 21, 2013 at 1:49 pm #51726
    ModernMuse
    Member

    Sorry, Brad's example is actually /about-page/. Hopefully you understand what I meant... 😉


    @ModernMuseNV | Portfolio | Personal Blog

    July 21, 2013 at 1:50 pm #51727
    IamRob
    Member

    The page is: http://www.italianluxuryweddings.com/wordpress/about-me

    I think I wrote the right name inside the code.

    July 21, 2013 at 2:06 pm #51731
    ModernMuse
    Member

    Not sure why your code doesn't work.

    The code below (with your page name of /about-me/) should add a custom widget directly below the header / above the nav bar:

    Link: https://gist.github.com/ModernMuse/f4a3c3ac4d5494a85518


    @ModernMuseNV | Portfolio | Personal Blog

    July 21, 2013 at 2:06 pm #51732
    Brad Dalton
    Participant

    You are right Rob. My bad. The WordPress Codex is wrong (Proof) and i should have tested the code.

    Please remove the single quotes/apostrophes from the page slug and it will work. Tested locally on your theme.

    Otherwise, please use the page i.d for your about me page. Its a bit sensitive to page names and slugs however i'd's always seem to work.

    Sincere apologies and love your site. Amazing images.

    if ( is_page(about-me) && is_active_sidebar( 'page-widget') ) {
    

    Or this:

    if ( is_page('278') && is_active_sidebar( 'page-widget' ) ) {
    

    Might also need to try this with and without the single quotes/apostrophes.


    Tutorials for StudioPress Themes.

    July 21, 2013 at 2:11 pm #51733
    IamRob
    Member

    mmm there's something wrong:

    "Parse error: syntax error, unexpected T_STRING in /web/htdocs/www.italianluxuryweddings.com/home/wordpress/wp-content/themes/modern-portfolio/functions.php on line 81"

    I can test online, this theme it's just an example. When it will works I'll replace the theme in my real domain 🙂

    Thank you 🙂

    July 21, 2013 at 2:13 pm #51734
    ModernMuse
    Member

    Ah...see, I learned something too. I was wondering why the original code didn't work since everything looked fine.

    When I tested Rob's code, I got a bunch of syntax errors. Now I know why.

    Hope you got it all fixed, Rob! Brad, you're a rock star. 🙂


    @ModernMuseNV | Portfolio | Personal Blog

    July 21, 2013 at 2:29 pm #51739
    Brad Dalton
    Participant

    Its probably just the apostrophes gave turned around when you copy from embedded code. Always copy using the view raw link and paste at the end of the functions.php file using a text editor like Notepad++.

    I did notice that this causes errors when copying from within the Gist and pasting here using the shortcodes for PHP.

    The code is tested and works so i'm sure you'll fix it very easily.

    Thanks @ModernMuseNV


    Tutorials for StudioPress Themes.

    July 21, 2013 at 2:32 pm #51741
    IamRob
    Member

    Yes, I fixed the error but I'm probably did something wrong cause I can't see the widget in the about page (id page 278). If the code works as you said I should see the widget I thought.

    July 21, 2013 at 2:40 pm #51745
    Brad Dalton
    Participant

    What did you put in the widget?


    Tutorials for StudioPress Themes.

    July 21, 2013 at 2:47 pm #51748
    IamRob
    Member

    I putted the same code:

    <center>



    </center>

    Now I can see the logo, but I've to customized the background and I don't know where. I'd like to have exactly the same header of the home page.

    July 21, 2013 at 2:47 pm #51749
    Brad Dalton
    Participant

    To use the same header on every page, you can install a plugin or use this CSS code:

    .page-template-default #header {
    background: url("images/header-page.png") no-repeat scroll 0 0 transparent;
    }
    

    Tutorials for StudioPress Themes.

    July 21, 2013 at 2:50 pm #51752
    Brad Dalton
    Participant

    Please mark this as resolved and start another post for your question. This way it will get resolved quicker.


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 20 posts - 1 through 20 (of 21 total)
1 2 →
  • 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

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