• Hi
    What a fantastic plugin!
    I’m using it to display testimonials on a customers site. Some of the texts are quite long and when I had them as html text just in a page, I was using the jQuery Collapse-O-Matic plugin to make the divs collapsible using the [expand][/expand] shortcodes in the div itself.

    Is there a way to use this when the text is included in a textarea?

    Thanks

    https://www.ads-software.com/extend/plugins/custom-fields-creator/

Viewing 1 replies (of 1 total)
  • Thread Starter NFWRo

    (@nfwro)

    Well I’ve been doing some searching around and it seems that I need to use the do_shortcode function from the codex. I’ve tried a number of different ways suggested by people in blogs and forum posts, but none of them seem to work in my code. I have a custom field that outputs a styled div for customers testimonials on a page template with the following code in:

    <?php
    $testimonial = get_post_meta($post->ID, 'testimonial', true);
    foreach($testimonial as $testimonial){
    echo '<div class="testimonial">';
    echo '<p>' . $testimonial['testimonial-text'] . '</p>';
    echo '<p class="testimonialname">' . $testimonial['testimonial-name'] . '</p>';
    echo '</div>';
    }
    ?>

    I think I need to use the
    echo do_shortcode('[iscorrect]'.$text_to_be_wrapped_in_shortcode.'[/iscorrect]');
    from the codex as I have an [expand][/expand] shortcode that creates a collapsible div when there is a lot of testimonial text.

    Can anyone help me as to how to correctly insert this into my code so that it is only used when the shortcode is present in the custom field value?

    Any help very greatly appreciated.

Viewing 1 replies (of 1 total)
  • The topic ‘Plugin – Custom Fields Creator:jQuery shortcode in textarea’ is closed to new replies.