Support

Home Forums Event Espresso Premium People Add-on – people list apply html tags to description

People Add-on – people list apply html tags to description

Posted: January 7, 2016 at 11:02 am


Daniel

January 7, 2016 at 11:02 am

When viewing the people list I noticed the descriptions ignore html tags.
I included <h3>Program Director</h3> at the top of the description. In the single view for that person it is styled correctly as an h3 title.

In the people list the words “Program Director” appear next to the rest of the description without any styling.

How can I fix this?


Tony

  • Support Staff

January 8, 2016 at 4:21 am

Hi Susan,

Which people list are you referring to?

The list within the event or /people/?


Daniel

January 8, 2016 at 6:04 am

Thanks for your reply.

I am referring to the “people” list not in the events.

Janet (Susan’s web developer)


Tony

  • Support Staff

January 8, 2016 at 6:19 am

The people list load when you view /people/ is actually an archive.

It sounds like your theme is loading the_excerpt() rather than the_content() for archive listings, which some themes often do.

Which theme are you using? Can you check within the theme options if it allows you to set what is displayed on archive pages?


Daniel

January 8, 2016 at 6:48 am

Tony,

This site uses the Kuorinka theme. I don’t see any options related to displaying info on the archive pages.

I just tried a Live Preview on the Twenty Sixteen theme and I see the “Program Director” with the HTML tags applied but the “Read More” functionality is gone.

How do I make this work so that the HTML tags are applied AND the “Read More” functionality remains?


Tony

  • Support Staff

January 8, 2016 at 8:37 am

Without creating your own custom excerpt function you can’t have HTML tags output within the_excerpt()

Within your other thread you modified content.php, that same template is used for this output.

So you could do a similar check within the section that calls the_excerpt() and call the_content() for espresso_people post types, you’ll then need to add a more link into the people posts to tell WP where to stop the content on that listing, but it should work.

Be sure to wrap the_content() correctly and output the_excerpt() for normal posts or you’ll run into problems with your other posts.


Daniel

January 8, 2016 at 9:18 am

Thanks Tony for your reply.

We’re at a point where some of this is over my head… I need to learn more about excerpts but here’s what I did notice.

A few days ago I discovered some code in the child theme functions.php file that replaced the excerpt:

remove_filter(‘get_the_excerpt’, ‘wp_trim_excerpt’);
add_filter(‘get_the_excerpt’, ‘wpse_custom_wp_trim_excerpt’);

(functions.php included code for the custom excerpt function).
The excerpt code was added by someone else.

After hours of debugging I noticed this code interfered with the “Register Now” button. When the custom excerpt code was included the “Register Now” button disappears. I had commented out the code to get back the “Register Now” button.

I just put it back to confirm that I see the styling on the People page the way I want it (i.e. the html tags are applied).

Is there a way I could modify this code so it doesn’t remove the Register Now button?

Thanks,
Janet


Josh

  • Support Staff

January 8, 2016 at 2:12 pm

Hi Janet,

It’s generally bad practice to remove built in functions from built in WordPress hooks. This is because plugins like Event Espresso depend on those filter functions being there, and the wp_trim_excerpt() function is no exception.

If you absolutely need to use the custom function on the get_the_excerpt hook, it should be conditionally loaded for only the standard WP post post type. This way the other post types can still have wp_trim_excerpt() run on the get_the_excerpt hook.


Daniel

January 8, 2016 at 3:43 pm

What I’m trying to do is a custom People Archive page.

  1. Title of page Instructors. (see this support thread)
  2. I NEED to be able to adjust the order of the Instructors.
  3. I would like some styling in the Excerpt. Such as an h3 and paragraphs
  4. Ideally, I would prefer to have this as a two column grid without a sidebar – like this http://torontopsychologicalservices.com/team-members/

Do I need to create a content-people.php file? or would it be content-espresso_people.php??


Josh

  • Support Staff

January 8, 2016 at 4:31 pm

The archive template’s name would actually be archive-espresso_people.php.

You can follow this reference:

http://codex.wordpress.org/Post_Type_Templates


Daniel

January 8, 2016 at 4:58 pm

Thanks Josh.

How can I order the instructors? I thought something like this might work https://wordpress.org/plugins/post-types-order/ but not with the way you’ve done custom post types.

I found this plugin – fixed the excerpt https://wordpress.org/plugins/advanced-excerpt/


Josh

  • Support Staff

January 8, 2016 at 5:11 pm

The way we added the custom post types in Event Espresso is through the WordPress plugin API. You can read my answer about re-ordering the people list archive in the other thread where you asked the same question:

https://eventespresso.com/topic/people-add-on-order-people-or-people-type-list-alphabetically-by-last-name/#post-187212


Daniel

January 8, 2016 at 8:15 pm

Oh Thanks Josh sorry I didn’t realize Janet had opened so many threads. I missed that one.

We are almost there. One last thing. I need the two Program Directors to be at the top of the list and then all the others to follow alphabetically. So we need ids=276,289 and then all the rest alphabetically.

~ Ruth


Josh

  • Support Staff

January 11, 2016 at 1:15 pm

Hi Ruth,

I mentioned in the other thread that this is a case where you’d run multiple loops.

The support post ‘People Add-on – people list apply html tags to description’ 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