Add Avatar Profile Picture To Single Pages In Ambiance Pro

This tutorial provides the code modification which adds your avatar image to single pages just like single posts which is coded by default.

Based on this unanswered forum question from a member of the Genesis community :

I use the Ambiance Pro Theme for my site. With this theme the profile picture is placed at the bottom-center of the posts feature image. My site has many pages and only a few posts. I would like for the profile picture to be displayed at the bottom-center of each pages’ feature image the same way it is displayed on a post. Is there a way to do this?

There’s 2 steps :

Step 1 : Modify the code on line 232 so it also executes on single pages like this :

//* Output gravatar before entry title
add_action( 'genesis_entry_header', 'ambiance_gravatar', 7 );
function ambiance_gravatar() {

if ( is_singular(array( 'post', 'page' ) ) ) {
	echo '<div class="entry-avatar">';
	echo get_avatar( get_the_author_meta( 'user_email' ), 240 );
	echo '</div>';
    }
}

Step 2 : Add the following CSS to the end of the Ambiance Pro themes style.css file :

.page .entry-avatar .avatar {
    margin-top: -125px;
}

@media only screen and (max-width: 980px) {

    .page .entry-avatar .avatar {
        margin-top: -65px;
    }
    
}

As simple as that.

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.