• Resolved snippet24

    (@snippet24)


    Say I need to add a loop inside the shortcode. Ok read the FAQ but can’t be done with somefunction in functions.php for example

    • This topic was modified 4 years, 5 months ago by snippet24.
    • This topic was modified 4 years, 5 months ago by snippet24.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter snippet24

    (@snippet24)

    An idea: what happens if I create a shortcode the regular way, and inside the “code editor” from this plugin I add just that shortcode may it work?

    Plugin Author vaakash

    (@vaakash)

    Hi @snippet24,

    Thanks for using Shortcoder.

    Inside shortcoder plugin, we cannot set PHP as content. But we can use HTML, CSS, Javascript and Shortcode.

    Yes you can paste another any “shortcode” inside shortcode content.

    Thanks,
    Aakash

    Thread Starter snippet24

    (@snippet24)

    Thank you! Well and would it be possible to allow/add it in the future? I know it can break the the website.. so with a word of warning. But the idea is to create a shortcode as Dev so the client can place it wherever he wants.

    Thread Starter snippet24

    (@snippet24)

    Well for the sake of completeness there’s a plugin that supports php
    ***
    I’m testing it…ok the plugin is broken hence I’m deleting it

    • This reply was modified 4 years, 5 months ago by snippet24.
    • This reply was modified 4 years, 5 months ago by snippet24.
    • This reply was modified 4 years, 5 months ago by snippet24.
    Thread Starter snippet24

    (@snippet24)

    What about doing this? getting the code from a template…

    function my_form_shortcode() {
       ob_start();
       get_template_part('my_form_template');
       return ob_get_clean();   
    } 
    add_shortcode( 'my_form_shortcode', 'my_form_shortcode' );
    Plugin Author vaakash

    (@vaakash)

    Hi @snippet24,

    Yes sure you can use the other plugin which supports PHP or you can try the code above which you have pasted to create your own PHP shortcode.

    Thanks,
    Aakash

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Is there a way to enable php with code in functions.php?’ is closed to new replies.