Tagged: x
-
AuthorPosts
-
September 28, 2016 at 1:49 pm #1194412
neilhartleyParticipantHi,
I wanted to add a shortcode to Cornerstone so I added this code (found on the forum) to my child theme functions.php file:
function load_script_content() {
return “<script type=”text/javascript” src=”https://tb109.infusionsoft.com/app/form/iframe/4fc552c4bb96829c0f73a94284297b58″></script>”;
}add_shortcode(‘custom_script’, ‘load_script_content’);
As soon as I hit “update”, I lost access to Appearance/Plugins and most of the WP capabilities. Apart from the homepage, the site is down.
Can someone take a look for me please? I’ll send login separately.
Thanks, Neil
September 28, 2016 at 1:53 pm #1194415
neilhartleyParticipantThis reply has been marked as private.September 28, 2016 at 2:59 pm #1194526
neilhartleyParticipantI’ve been able to get the back-end/site working again by changing the name of the child theme in cpanel –> default theme; and then back to the original name after I deleted the change I made in the functions.php file.
The only problem is I want to create the shortcode for use in Cornerstone…was there something wrong with the code I used above?September 28, 2016 at 3:58 pm #1194621
JadeModeratorHi Neil,
You can try using this code in the child theme:
add_action( 'wp_enqueue_scripts', 'load_script_content' ); function load_script_content() { wp_enqueue_script( 'my-script', 'https://tb109.infusionsoft.com/app/form/iframe/4fc552c4bb96829c0f73a94284297b58', array(), '1.0.0', true ); }Hope this helps.
September 28, 2016 at 4:11 pm #1194638
neilhartleyParticipantThanks. How do I use that in Cornerstone? There is not shortcode element and when I use [my-script] in a text element I only see [my-script] when previewing. At least it didn’t crash!
September 28, 2016 at 4:21 pm #1194664
neilhartleyParticipantSorry, maybe I didn’t explain well enough. I only want to use the shortcode one time in a specific place on a page. What you sent me, appears on every page underneath the footer.
September 28, 2016 at 7:22 pm #1194834
JadeModeratorHi Neil,
Try to add the JS code in a Raw Content element instead.
Let us know how it goes.
September 29, 2016 at 9:42 am #1195803
neilhartleyParticipantI tried that. If I enter the code in the element, I just see the code displayed on the page. I then added the code to settings but then I don’t see how to link the raw element to what’s in settings. Any help gratefully received! Thanks, Neil
September 29, 2016 at 11:31 am #1195969
RupokMemberHi there,
If you want to use within page using RAW Content then you need to place the plain script there within script tag NOT the link to external file file.
Let’s try and provide the page URL where you are trying to add this.
September 29, 2016 at 11:57 am #1196008
neilhartleyParticipantI provided the login details earlier in this thread. The page I want to add this to is in draft called Getting Started. It’s section 6 on that page. Thanks!
September 29, 2016 at 4:53 pm #1196403
RadModeratorThis reply has been marked as private.September 29, 2016 at 5:19 pm #1196418
neilhartleyParticipantThat looks great. The only thing is, when I try to Edit with Cornerstone to look at how you achieved it, I get bounced back to the login screen…
September 29, 2016 at 10:51 pm #1196845
RadModeratorHi there,
It shouldn’t redirect you to the login page if you’re already logged in. It’s draft page where normal user can’t see, hence, you’ll have to login.
Thanks!
September 30, 2016 at 9:37 am #1197339
neilhartleyParticipantI tried several ways all where I’m logged in, yet when I click Edit with Cornerstone it takes me back to the login screen. I’m sorry but it’s what happens.
September 30, 2016 at 10:12 am #1197382
neilhartleyParticipantIt was set as Published not as Draft. When I set it to Draft I was able to edit it using Cornerstone. Thanks for your support!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1194412 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
