Skip Navigation

[Resolved] Post excerpt

This support ticket is created 4 years 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.

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 6 replies, has 2 voices.

Last updated by Jay 4 years ago.

Assisted by: Shane.

Author
Posts
#1894525

Jay

Having learnt in "Templates for Items in Directory Sites video" to use Toolset single text for a description, and built that page.

I then watched "Creating a View in WordPress video" and cant use excerpt of post as described.

Ive seen a post about shortcode, but I bought Toolset as all the videos said I don't need to learn code.

Is there a workaround to this yet as Im sure others have followed the training and come up against this problem?

What is the link to your site?
hidden link

Thanks

#1894999

Shane
Supporter

Languages: English (English )

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

Screenshot 2021-01-05 at 9.40.30 AM.png

Hi Jay,

Thank you for getting in touch.

Based on your query i'm assuming that you want to display the text that has been stored in your excerpt field correct?

If so can you try using the single field block and selecting the Post excerpt as the field to get the value from. See Screenshot.

Please try this and let me know if it helps.

Thanks,
Shane

#1895875

Jay

Hi Shane
Thanks for replying.
Sort of, but the text is in a toolset single field not the standard WP text field.
Thanks
Jay

I wonder can i mix and match information, and would it get indexed / archived correctly.

#1896273

Shane
Supporter

Languages: English (English )

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

Hi Jay,

Not sure what you mean by this
Sort of, but the text is in a toolset single field not the standard WP text field.

Can you provide a screenshot of what you mean ?

I wonder can i mix and match information, and would it get indexed / archived correctly.

Mix and match which fields ?

Please let me know so that I can provide a bit more clarity for you.

Thanks,
Shane

#1896889

Jay

Hi Shane,
I was sure i answered and posted yesterday, but it doesn't appear.
What i am after is the ability to have a toolset "single field" display an excerpt from a toolset "fields and text" field.

The option for excerpt is only available to standard Word Press text / paragraph.

This tells how to deal with it but I cant code.
https://toolset.com/forums/topic/create-excerpt-from-custom-field-2/

So there is a solution, It's just I cant implement it.

I was wondering if anybody else had found an easy workaround.
Thanks
Jay

#1897391

Shane
Supporter

Languages: English (English )

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

Hi Jay,

Thank you for the clarity. I believe I understand what you are saying now.

This is a shortcode that i made which involves the use of our Toolset shortcodes being used instead of the single field block.

Here are the steps to get it working:

1. Copy the code below to the Toolset custom code section in Toolset -> Settings -> Custom Code and create a new custom code.

// Add Shortcode
function shorten_string( $atts ) {
 
    // Attributes
    $atts = shortcode_atts(
        array(
            'length' => '',
            'string' => '',
        ),
        $atts
    );
 
    return substr($atts['string'], 0, $atts['length'])."...";
     
 
}
add_shortcode( 'shorten_string', 'shorten_string' );

2. Ensure that after you've saved the snippet you've clicked the activate button.
3. Go to your template that you want to add the excerpt to and then use the shortcode like below. The code should be added into the Classic editor block.

[shorten_string string="[types field='ingress' output='raw']" length='50']

Where [types field='field-slug-goes-here' output='raw'] is the shortcode to get the values from your Types field. Replace the "field-slug-goes-here" with the actual slug of your custom field.

Please let me know if this was able to help you resolve the issue.

Thanks,
Shane

#1897455

Jay

My issue is resolved now. Thank you!
Thanks so much, I not as scared of code as i was before.