Support

Home Forums Event Espresso Premium People Add-on – Display image on single people page

People Add-on – Display image on single people page

Posted: January 7, 2016 at 11:28 am


Daniel

January 7, 2016 at 11:28 am

How do I display the person’s image on the individual people page?


Lorenzo Orlando Caum

  • Support Staff

January 7, 2016 at 1:30 pm

Hi Susan, here is how to make that change:

https://eventespresso.com/topic/people-featured-image/#post-170724


Lorenzo


Daniel

January 7, 2016 at 2:20 pm

Thanks Lorenzo for your reply.

I modified the file content-espresso_events-people.php to display the image as follows:

<?php foreach ( $persons as $person ) : ?>
// Add image
<div><?php echo get_the_post_thumbnail( $person->ID(), 'full' ); ?></div>

I copied the file to the root directory of my child theme but I don’t see the image displayed. Am I missing something?

Thanks,
Janet


Daniel

January 7, 2016 at 2:32 pm

I tried 2 more things but still don’t see the image:

1) I changed ‘full’ to ‘thumbnail’
2) I updated the plugin file directly (just to see if it made a difference)
(i.e. I updated eea-people-addon/public/templates/content-espress_events-people.php)

Any ideas what I’m doing wrong?


Daniel

January 7, 2016 at 3:04 pm

Ok. I just noticed that the image is displaying on the events page NOT the people page.

Could you please tell me what code I need to change to add the image on the people page for a single person?

Thanks!
Janet (fyi, I’m Susan’s web developer)


Lorenzo Orlando Caum

  • Support Staff

January 7, 2016 at 5:35 pm

Hi Janet,

Please do not edit any of the plugin files directly. Those customizations will be lost when you update the plugin.

Could you go ahead and relocate the customization here?

/wp-content/uploads/espresso/templates

Again, we don’t want you to make these changes and then lose them when you update.


Lorenzo


Daniel

January 7, 2016 at 5:38 pm

I had saved a copy and already put it back to the way it was.

I’d still like to know how to display the person’s image on the “people” page NOT event page.

Please advise.

Thanks!
Janet


Lorenzo Orlando Caum

  • Support Staff

January 7, 2016 at 6:33 pm

Hi,

There is a different file that is used for the single person view:

content-espresso_people-details.php

Relocate a copy here or into your child themes folder if you are using one:

/wp-content/uploads/espresso/templates

Then you can add a line to retrieve and display the featured image:

http://cl.ly/350x2d07093Q

I added it towards the top so it would appear above the other information.


Lorenzo


Daniel

January 7, 2016 at 7:55 pm

Hi Lorenzo,

Thanks again for your reply.

I updated the file content-espresso_people-details.php as you suggested and tried placing it in the child theme folder and then in wp-content/uploads/espresso/templates

No image was displayed…

Any ideas?
Janet


Daniel

January 7, 2016 at 7:58 pm

I tried changing the line:

<h3><?php _e(‘Events this person is involved with:’,

to
<h3><?php _e(‘Events that this person is involved with:’,

to see if it got updated and I don’t see the word “that”.

Is this the wrong template file?


Tony

  • Support Staff

January 8, 2016 at 4:49 am

Hi Janet,

content-espresso_people-details.php is the correct template file for the single person details.

Are you placing the template within the root directory of your child theme?

Are you loading your own single-espresso_people.php file? If so then this needs to be loaded differently as EE then assumes you are taking full control of the output – http://take.ms/JWgRD

Once we figure out why the template is not loading for you we can then work on getting the feature image loading.


Daniel

January 8, 2016 at 6:23 am

Tony,

Thanks for your reply.

I tried placing the template in the root directory of the child theme and also in the directory /wp-content/uploads/espresso/templates. I’ve removed it from the espresso templates directory.

I currently have the file in the root directory of the child theme but it does not appear to be loading.

I am not loading my own single-espresso_people.php file.

What do you suggest I look at next?

Thanks,
Janet


Tony

  • Support Staff

January 8, 2016 at 6:30 am

Can you link me to the page you are looking to edit please?


Daniel

January 8, 2016 at 6:55 am

Tony,

I removed the file content-espresso_people-details.php from the child theme root directory -as it did not appear to be loading.

I just noticed that if I do a Live Preview on a different theme Twenty Sixteen I see the person’s image on the single page. The styling is gone and the Read More is gone but the image appears.

Any suggestions on how I can get it to show the image using the Kuorinka theme?

Thanks,
Janet


Tony

  • Support Staff

January 8, 2016 at 7:54 am

The details shown all depend on your theme, a ‘person’ is a single post, so if the theme outputs the feature image on a single post (without also checking the post type) then the image would be shown for people too.

So with the Kuorinka your going to need to build out custom templates to display what you need. The content-espresso_people-details.php template loads at the bottom of the page after the content, so it may not be suitable for loading the feature image in your case.

I installed Kuorinka on a test site and created a child theme there, loading the content-espresso_people-details.php file works from there, the parent and /uploads/espresso/templates/ so I’m not sure why its not working for you.

A quick fix for the image is to copy the content.php file to your child theme, check for the post type ‘espresso_people’ and then output the_post_thumbnail(), something like:

if ( get_post_type() == 'espresso_people' && has_post_thumbnail()) {
	the_post_thumbnail( 'kuorinka-large', array( 'class' => 'thumbnail-large' ) );		
}

Wherever you would like to output the feature image for people.


Daniel

January 8, 2016 at 8:10 am

Tony,

Thank you so much for your help and taking the time to install the Kuorinka theme.

I also really appreciate your suggestion/quick fix. I followed your instructions and itt does exactly what I want!

Thanks so much for your help!
Janet


Tony

  • Support Staff

January 8, 2016 at 8:19 am

You’re most welcome, Janet 🙂

The support post ‘People Add-on – Display image on single people page’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso