Modern Portfolio "About" widget

Community Forums Forums Design Tips and Tricks Modern Portfolio "About" widget

This topic is: resolved


This topic contains 20 replies, has 3 voices, and was last updated by  IamRob 2 years, 4 months ago.

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
  • #51411


    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,



    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?



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



    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++.



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



    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.



    Yes, I did.

    This is the website:

    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
    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 –>';





    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’ ) ) {



    Sorry, Brad’s example is actually /about-page/. Hopefully you understand what I meant… ;)



    The page is:

    I think I wrote the right name inside the code.



    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:




    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.



    mmm there’s something wrong:

    “Parse error: syntax error, unexpected T_STRING in /web/htdocs/ 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 :)



    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. :)



    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

Viewing 15 posts - 1 through 15 (of 21 total)

You must be logged in to reply to this topic.