• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

RESOLVED Unable to get woody snippets to work

Messages
5
Likes
0
Points
1
#1
I'm trying to use woody snippets plugin in wordpress but can't get it to work.
Here's what I've done:
  1. downloaded and activated woody snippets
  2. created the following php snippet:
    <?php
    add_action('init','print2');
    function print2($str){
    $str = str_replace(",","<br>",$str);
    print $str . "<br>";
    }
    ?>
  3. got the short code and added the following to a static page
    [wbcr_php_snippet id="96"]
    $test="yes";
    print2("$test");
    [/wbcr_php_snippet]
unfortunately, nothing happens. can someone provide steps to make this work?

UPDATE: Do woody snippets work in static pages or do we need to use a template?
 
Last edited:

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#2
Hello.

No need to write code inside the shortcode.
It must be:
1) Snippet:
PHP:
function print2($str){
    $str = str_replace(",","<br>",$str);
    print $str . "<br>";
}
$test="yes,no,maybe";
print2($test);
2) Shortcode in post:
[wbcr_php_snippet id="96"]
 
Messages
5
Likes
0
Points
1
#3
Thanks, I tried that but it still doesn't work. Are you SURE woody snippets will run in a STATIC PAGE and if so how?
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#5
What exactly isn't working? Is the shortcode displayed in the page text? Or the snippet code doesn't work?
 
Messages
5
Likes
0
Points
1
#6
Hi, Thanks for getting back. I was able to resolve the issue. I was confused by the play and stop button for the snippet under the status column. All's good.

Can I use Woody snippets to create a footer that has a form and submit button in it? Is there an example or tutorial?
 
Last edited:

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#7
In woody, you can create a snippet with a form and a submit button. But to place it in the footer your template must have footer widgets. Alternatively, select Auto-placement in the snippet settings and select Footer. Then the snippet will appear before the closing </body>tag