Skip Navigation

[Resolved] Excerpt for custom field

This support ticket is created 3 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 9 replies, has 2 voices.

Last updated by Shane 3 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#1915019

Tell us what you are trying to do?
I am trying to create an excerpt for a custom field.

Is there any documentation that you are following?
following this:
https://toolset.com/forums/topic/i-would-like-to-show-a-excerpt-of-a-custom-user-field-that-i-have-created/

I used Snippet to place the PHP in my theme to call the shortcode
I created a new custom field called About Me Excerpt and put this shortcode in the default value [trimfield length="100" more="Read more..." field="about-me" postid="[wpv-post-id]"] and included it in a post form.
I hid the custom field from displaying with HTML.
I tried to add the custom field to a view but it comes up empty.

what am I doing wrong

Is there a similar example that we can see?

What is the link to your site?
under development

#1915217

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Wendy,

Thank you for getting in touch.

Can you let me know the field type that you are trying to use this code on ?

Thanks,
Shane

#1915229

Hey Shane, it is for a wsiswg field

#1915233

btw. i have a truly dumb question. I am reading lots of tickets and they all say pass the short code in your view. Where exactly do you do this? Thanks.

#1915281

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Wendy,

Would you mind allowing me to have admin access to the site so that I can have a look at this issue for you.

I've enabled the private fields for your next response. Also please let me know the page where you are testing out the shortcode and the WYSIWYG field.

I am reading lots of tickets and they all say pass the short code in your view. Where exactly do you do this? Thanks.

For me to answer this I will need a little more context about the shortcode and what you are doing with it in order to provide an accurate answer.

Thanks,
Shane

#1918061

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Wendy,

To restrict the my account page to only logged in users I would suggest having a look at the link below.
https://toolset.com/course-lesson/restricting-access-to-pages/

Secondly, can you setup the my account page with the custom code and excerpt as you would want it so that I can take a look at what happens?

Right now i'm not seeing the shortcode on the page.

Thanks,
Shane

#1919577

Shane, I did follow that course. and it will not work. (see the my account page as logged in. It works fine, when I am logged in (but it shows me all custom posts because I am the admin. when I log out as me and try to log in as a user, then nothing displays when they look at" their "my account page

As for the excerpt, I tried to call it in the content template that is in the view on the my account page. Thanks so much

#1919641

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Wendy,

I see a few issues here.

The first issue is with the correct producer profile showing. I'm seeing where you've created all the producer's profile. The only way to make this work and filter correctly is to allow each user to create their own profile so they become the author and then we can use the filter to sort them by the current user. So only the current user's profile will show.

Secondly the trimming of the text should now work.

Thanks,
Shane

#1919665

Shane, thanks so much. I am going to change the author and test it. For the trimming, I am super greatful that you fixed it, but can you please tell me what you fixed - so I can learn to do it on my own? Thanks so much

#1919705

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Wendy,

All I did was to test the code itself and modify it slightly so that it can get the correct values, also you were using the incorrect slug for the wysiwyg field so I had to change it to the correct one.

If you check the code you can see the changes that i've made.
Thanks,
Shane