• Resolved hiitsdustindavis

    (@hiitsdustindavis)


    I am trying to use the Read More plugin (https://ww.wp.xz.cn/plugins/expand-maker/#description) in a textarea. The Read More plugin relies on wrapping content to be hidden in a shortcode. I’ve tested this in the standard WordPress TinyMCE WYSIG and it works. However when placed in a Custom Field Suite textarea the shortcodes text is rendered as is and displays no showing or hiding functionality.

    The page I need help with: [log in to see the link]

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

    (@hiitsdustindavis)

    RESOLVED – USE do_shortcode() and with the field name as the argument. Also this works textarea and WYSIWYG field types. Not sure about others.

    When calling the field I used:
    echo do_shortcode( $data[‘_attorney_summary’] );

    Instead of the normal:
    echo $data[‘_attorney_summary’];

    Here is an example:
    <?php if ( have_posts() ) : ?>

    <?php while ( have_posts() ) : the_post();

    $data = CFS()->get( false, get_the_ID(), array( ‘format’ => ‘raw’ ) );
    echo do_shortcode( $data[‘_attorney_summary’] );

    <?php endwhile; ?>

    <?php endif; ?>

Viewing 1 replies (of 1 total)

The topic ‘Shortcode not working’ is closed to new replies.