I'm trying to create a javascript snippet but it doesn't seem to want to work. I created a snippet that just has:
(function(){
document.write(5+6);
console.log("help");
})();
I have a shortcode of [wbcr_js_snippet id="483"]; which I place in a custom page:
This will work if I set it to automatic insertion but trying to use the shortcode doesn't work
(function(){
document.write(5+6);
console.log("help");
})();
I have a shortcode of [wbcr_js_snippet id="483"]; which I place in a custom page:
Code:
<?php /* Template Name: swaghome */ ?>
<?php
require( '../../../wp-load.php' );
get_header(); ?>
<div id="primary" class="site-content">
[wbcr_js_snippet id="483"];
<div id="content" role="main">
<?php
print_r($_POST);
if(isset($_POST["place"]) && $_POST["place"] === "foot") $place="foot";
else if(isset($_POST["place"]) && $_POST["place"] === "involved")$place="involved";
else $place="home";
echo $place;
?>
</div><!-- #content -->
</div><!-- #primary -->
<?php
require( '../../../wp-load.php' );
get_footer();
?>
Last edited: