QUESTION How to include snippets within snippets

Status
Not open for further replies.

keaton591

New member
Messages
2
Likes
0
Points
1
#1
I am trying to code a snippet and would like to include other snippets (including JS and PHP) inside the main snippet. How would I go about doing this?
 

alexkovalev

Program developer
Staff member
Messages
267
Likes
19
Points
18
#2
Hi,

You can do it like this:
PHP:
echo do_shortcode('[wbcr_snippet id="xxx"]');
echo do_shortcode('[wbcr_php_snippet id="xxx"]');
echo do_shortcode('[wbcr_text_snippet id="xxx"]');
Best regards, Alex
 

keaton591

New member
Messages
2
Likes
0
Points
1
#3
Thanks Alex,
That solution worked for my php snippets, but not for the javascript. Is there something I need to do differently to include javascript snippets?
 

alexkovalev

Program developer
Staff member
Messages
267
Likes
19
Points
18
#4
In universal snippet, you can do it like this:
PHP:
<?php echo do_shortcode('[wbcr_php_snippet id="xxx"]'); ?>
Best regards, Alex
 
Status
Not open for further replies.