Team Members Staff Authors or User Profile Page Template for Genesis

In this post, i’ll give you the code you can use to create a page template which showcases the members of your team. You can use this for staff, authors of a blog or user profiles for members.

This solution, in my opinion, is the most flexible, efficient and easiest to make your own because:

  1. There’s only one page template with minimal code.
  2. A small amount of PHP code for your functions file.
  3. The use of Dashicons which are already included in WordPress.
  4. No need to install any plugins.
  5. No need to create a custom post type.
  6. No need to host images or icons on your server.
  7. The CSS code works on any theme as all CSS code uses custom classes and not theme specific classes.

Here’s a very basic example of what the finished product looks like:

Team Template for staff

Functions File

This PHP code goes at the end of your child themes functions.php file:

//* Register widget areas
genesis_register_sidebar( array(
	'id'          => 'intro-widget',
	'name'        => __( 'Intro Widget', 'wpsites' ),
	'description' => __( 'Displays Full Content Sidebar Width.', 'wpsites' ),
) );
genesis_register_sidebar( array(
	'id'          => 'people-widgets',
	'name'        => __( 'People Widgets', 'wpsites' ),
	'description' => __( 'Displays People Side by Side 50%', 'wpsites' ),
) );

You’ll also need to enqueue the Dashicons for the front end:

page_people.php

This PHP needs to be added to a new page template named page_people.php using a text editor like notepad++

<?php

/* Template Name: People Template */

add_action( 'genesis_meta', 'wpsites_meta' );

function wpsites_meta() {

	if ( is_active_sidebar( 'intro-widget' ) || is_active_sidebar( 'people-widgets' ) ) {

        add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
		
	
        remove_action( 'genesis_before_header', 'genesis_do_nav' );
        remove_action( 'genesis_after_header', 'genesis_do_subnav' );


        remove_action( 'genesis_header', 'genesis_header_markup_open', 5 );
        remove_action( 'genesis_header', 'genesis_do_header' );
        remove_action( 'genesis_header', 'genesis_header_markup_close', 15 );
		
		remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );

		add_filter( 'body_class', 'wpsites_add_body_class' );

		remove_action( 'genesis_loop', 'genesis_do_loop' );

		add_action( 'genesis_after_loop', 'intro_widget' );
		
		add_action( 'genesis_after_loop', 'people_widgets' );

     }
}	 
	   
	   
function wpsites_add_body_class( $classes ) {

   $classes[] = 'people-template';
   return $classes;
   
}	   


function intro_widget() {

    echo '<div class="intro-section">';

	genesis_widget_area( 'intro-widget', array(
		'before' => '<div class="intro-widget widget-area"><div class="wrap">',
		'after'  => '</div></div>',
	) );
	
	echo '</div>';

}
	
	
function people_widgets() {

    echo '<div class="people-section">';

    genesis_widget_area( 'people-widgets', array(
		'before' => '<div class="people-widgets widget-area"><div class="wrap">',
		'after'  => '</div></div>',
	) );
	
	echo '</div>';

}	


genesis();

Style Sheet

This CSS code needs to be pasted at the end of your child themes style.css file:

.people-widgets .widget {
	float: left;
	padding: 2% 4% 2% 4%;
	width: 50%;
}

.intro-widget {
padding: 2% 4%;
text-align: center;
background-color: #1EC9B3;
color: #fff;
width: 100%;
}

.intro-widget .site-container {
background: #1EC9B3;
}

.people-template .entry-image {
padding-right: 20px;
padding-bottom: 20px;
}

.avatar {      
background-color: #F5F5F5;      
border: 0;      
border-radius: 50% 50% 50% 50%;      
padding: 0; 
} 


.intro-widget .widget-title {
    font-size: 2.6rem;
    margin-bottom: 2.4rem;
    text-transform: uppercase;
	text-align: center;
	color: #fff;
}

.people-widgets .widget-title {
color: grey;
font-size: 21px;
margin-left: 150px;
font-weight: 600;
}

.people-widgets p {
font-size: 15px;
text-decoration: italic;
}

.dashicons-twitter1:before { 
content: "\f301";
display: inline-block;
float: left;
color: #1EC9B3;
-webkit-font-smoothing: antialiased;
font: normal 24px/1 'dashicons';
}

.dashicons-admin-dashboard:before { 
content: "\f102";
display: inline-block;
float: left;
color: #1EC9B3;
-webkit-font-smoothing: antialiased;
font: normal 24px/1 'dashicons';
}

.people-template .entry-content a {
border-bottom: 0;
color: #1EC9B3;
}

.people-template a {
border-bottom: 0;
color: #1EC9B3;
}

.people-template a:hover {
border-bottom: 0;
color: #1EC9B3;
}

.social-people {
margin-bottom: 10px;
}

.people-widgets {
background-color: #f5f5f5;
}

@media only screen and (max-width: 767px) {
	
	.people-widgets .widget {
	padding: 2% 4%;
	width: 100%;
   }

}

I’ve added a lot of CSS which you can easily modify to suit the styling of your theme.

HTML – Genesis User Profile Widget

This HTML needs to be pasted in the Custom Text field of the Genesis User Profile widget for each team member.

You will need to modify this HTML by changing the links to each members Twitter & website link.

Here’s what one of the Genesis user profile widgets look like:

genesis user profile widgets

You can easily change all the colors, extend the intro header full width and modify the CSS code to your own liking.

The Genesis Users Profile widget enables you to select any user and display either the user profile or a custom profile.

You could also use another type of user profile widget like which Jetpack includes or simply use a text widget with HTML.

Another option is to use the Genesis featured posts/pages widget.

Related Solutions


Comments

28 responses to “Team Members Staff Authors or User Profile Page Template for Genesis”

  1. Anthony Hickey Avatar
    Anthony Hickey

    Brad,

    I appreciate what you are saying.

    I have been going through your posts, and believe it or not, you have solved the above problem here:

    http://wpsites.net/web-design/flexible-responsive-widgets-template-for-genesis/

    I am looking at doing some work for local sports club and officials, needless to say, don’t have a Gravatar – thus my problem.

    But using your Featured Posts method, as you outline in your post ‘Flexible Responsive Widgets

    Template for Genesis’, I can easily overcome my problem (although no Dashicons) and it looks terrific.

    Thanks again.

    1. Brad Dalton Avatar
      Brad Dalton

      Yes, the team template was based on the flexible widgets template which will work in most cases.

    2. Herb Trevathan Avatar
      Herb Trevathan

      Awesome!

      1. Brad Dalton Avatar
        Brad Dalton

        Thanks Herb.

  2. Anthony Hickey Avatar
    Anthony Hickey

    Thanks Brad.
    A terrific page template.

    1. Brad Dalton Avatar
      Brad Dalton

      I could have coded this differently but this was the most efficient way to do it because only the HTML needs modifying for each users website url and Twitter handle.

      If i had of used the WordPress User Profile fields, it would have required significantly more code and taken longer to load.

  3. Anthony Hickey Avatar
    Anthony Hickey

    Brad,
    Is it possible to do all above pulling images from Media Library instead of users?

    1. Brad Dalton Avatar
      Brad Dalton

      Anythings possible Anthony. You could code that different ways.

  4. Super tutorial!
    Thanks Brad.

    1. Brad Dalton Avatar
      Brad Dalton

      Thanks Kris.

  5. I thought of this for a while.
    1. Add the tweeter and Facebook url to the user profile via PHP code.
    2. Create a page called staff and have it pull all the staff information in a grid or a loop and use your CSS.
    a. Name
    b. Twitter
    c. Bio
    d. Other links.

    I did this a long time ago for a friend when we were building his website. I’m in the learning process to learn all the hooks for genesis right now. SO, I would be no help at all, lol..

    -Scot

    1. Brad Dalton Avatar
      Brad Dalton

      Hi Scot

      There’s different ways to do this and i did look at pulling the social links using PHP code but then you would need to hard code them into the template which isn’t flexible.

      You would also need to create custom fields and meta boxes if you didn’t hard code them which relies on the use of a plugin or a significant amount of code.

      That’s why HTML is a far more flexible method and most people are comfortable with adding HTML links.

      1. I agree with you. One day, I hope just to design a theme that has everything in it..haha..
        -Scot

        1. Brad Dalton Avatar
          Brad Dalton

          Me too! hahaha

  6. Herb Trevathan Avatar
    Herb Trevathan

    haha the paste:
    [code]
    //* Add support for SVG uploads
    function cc_mime_types( $mimes ){
    $mimes[‘svg’] = ‘image/svg+xml’;
    return $mimes;
    }
    add_filter( ‘upload_mimes’, ‘cc_mime_types’ );
    [/code]

    1. Brad Dalton Avatar
      Brad Dalton

      It works?

  7. Herb Trevathan Avatar
    Herb Trevathan

    This post was awesome! Thanks Brad : ) (been too busy to blog or comment…hahaha) it was nice to come out of my code cave and see cool new posts like this.

    Love the ever evolving design

    1. Brad Dalton Avatar
      Brad Dalton

      hahahaha. Prefer working on other peoples sites than my own.

      Read a post yesterday on CSS Tricks which used a CPT and ACF plugin to do this but seems really complicated and hard to customize.

      Only took 20 minutes to do the PHP and a couple of hours for the CSS on Genesis.

      1. Herb Trevathan Avatar
        Herb Trevathan

        hahaha : ) yeah just added drop shadows isung css today on a woocommerce website – I like Chris’s website also but his design is stale, only because I look at it so much…not that it is bad.

        I am really digging using svg’s for logos and vector icons etc. makes the responsive piece much easier.

        Do you have a tut here on adding svg to the allowed file formats to upload? I have had to look that up twice now…I need my own pastebin of sorts.

        I have been thinking about building a snippet library in wordpress just never taken the time to set it up…any idea on a good way to do that?

        Greg Rickaby has his stuff on his website it’s kinda cool – embedding github snippets would work, I remember you had a great tut on how to not only do that but also to style the embeds with css : )

        gotta look that up again also…

        1. Brad Dalton Avatar
          Brad Dalton

          I really need to learn more about SVG’s and vector icons because i think they can make a site look really good and re-size really well maintaining the quality.

          Never really used them but i will see if i can find out how to add them to the media library. I’m sure you could upload them to your child themes images folder.

          Me too on the Snippet library but still need to work out whether to use Github Gist’s to host the code or a Syntax highlighter plugin.

          I like what Bill Erickson has done with his code snippet library but not sure it would work for mine as i have over 1000 snippets now.

          I know Greg Rickaby ranks well well for that page of code snippets so its a good idea.

          Try this for the SVG file type upload in WordPress:
          [code]
          function enable_svg_upload_wordpress( $mimes ){
          $mimes[‘svg’] = ‘image/svg+xml’;
          return $mimes;
          }
          add_filter( ‘upload_mimes’, ‘enable_svg_upload_wordpress’ );
          [/code]

          Source http://css-tricks.com/snippets/wordpress/allow-svg-through-wordpress-media-uploader/

          1. Herb Trevathan Avatar
            Herb Trevathan

            cool, I just pasted in what I used on last project…the hardest part was getting the svg export out of illustrator. I spend so much time in photoshop illustrator slows me to a crawl…

            but I got it to work, and manage every time, before long I will be quicker, I design everything that needs to scale or be rendered @2x in illustrator now…other than that I am straight photoshop.

            with just the need for @2x it is already easier to use vector and svg stuff…then responsive makes it just a new requirement for everything.

            it’s cool though all my illustrator stuff work in photoshop as smart objects (somewhere someone is laughing…) so it work out well.

            so glad web design has gotten interesting and challenging again : )

          2. Brad Dalton Avatar
            Brad Dalton

            I find it hard to focus on so many types of code and software so i stick to PHP and CSS.

  8. I was looking for something like this the other day. I ran across a genesis plugin that does the same thing but uses Custom post types. I had to update a few things in their plugin but overall works great. “Genesis Agent Profiles” Thanks for this tutorial. I will see how I can apply some of this to what I’m using. Brad, the link i sent you the other day. It is under my staff page for an example.
    -Scot

    1. Brad Dalton Avatar
      Brad Dalton

      Hello Scot

      Thanks for the tip on the plugin.

  9. Brad, I added this to the Metro Agentpress demo I have. I can’t get those Dashicons to show up. Did I miss a step? http://demo3.cre8tivediva.com/?page_id=978.

    1. Brad Dalton Avatar
      Brad Dalton

      Only works on WordPress 3.8 because they’re included in the core unless you add them manually which you can do or install a plugin like MP 6 http://wordpress.org/plugins/mp6/

      You’ll also need to enqueue dashicons for use on the front end of logged out users or they won’t display.

  10. Love it! Two thumbs up Brad!

    1. Brad Dalton Avatar
      Brad Dalton

      Thanks Anita.

Leave a Reply

Join 5000+ Followers

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