WordPress.org

Support

Support » Plugins and Hacks » Simple Fields » [Resolved] Shortcodes are not executing in the simple field text box

[Resolved] Shortcodes are not executing in the simple field text box

  • Hello,
    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”>
     
    </div>
    </div>

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

    Thanks!

    http://wordpress.org/extend/plugins/simple-fields/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Pär Thernström

    @eskapism

    try something like this

    $your_text = apply_filters("the_content", $your_text);

    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:

    <?php
    $your_text = simple_fields_value("field_slug_goes_here");
    $your_text = apply_filters("the_content", $your_text);
    ?>
    
    <?php echo $your_text ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Shortcodes are not executing in the simple field text box’ is closed to new replies.
Skip to toolbar