Simple Fields
[resolved] Shortcodes are not executing in the simple field text box (3 posts)

  1. Sudhanshu Dubey
    Posted 3 years ago #

    I was about to execute a short code inside simple field text box ,but unfortunately its not being executed just printing the same as it is written in the text field ..Like I have made a shortcode for displaying some HTML and gave a name named as [caption]..when I write [caption]n in the text field its not showing the HTML part but if I put it in editor it works!

    Here is the code I am about to use
    <div class="box_wrap clearfix">
    <div class="heading">Call to Action</div>
    <div class="box">

    In short how to run short code inside text field of Simple field WordPress plugin
    Any Idea how to resolve this...



  2. Pär Thernström
    Plugin Author

    Posted 3 years ago #

    try something like this

    $your_text = apply_filters("the_content", $your_text);
  3. cokeyblokey
    Posted 3 years ago #

    Thanks Pär. I too was having the same problem trying to get a shortcode to execute from a Simple Field. Although it took me a little while to work it out (I'm a PHP novice), your suggestion got it working.

    For anyone wanting to do the same, here's an example of what you need in your template file:

    $your_text = simple_fields_value("field_slug_goes_here");
    $your_text = apply_filters("the_content", $your_text);
    <?php echo $your_text ?>

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Simple Fields
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.