-
AuthorPosts
-
March 10, 2016 at 3:56 pm #832645
Hi there,
I need to add the following to the head section of a page on my website:
<link href="https://www.tfaforms.com/form-builder/4.3.0/css/wforms-layout.css" rel="stylesheet" type="text/css" /> <!--[if IE 8]> <link href="https://www.tfaforms.com/form-builder/4.3.0/css/wforms-layout-ie8.css" rel="stylesheet" type="text/css" /> <![endif]--> <!--[if IE 7]> <link href="https://www.tfaforms.com/form-builder/4.3.0/css/wforms-layout-ie7.css" rel="stylesheet" type="text/css" /> <![endif]--> <!--[if IE 6]> <link href="https://www.tfaforms.com/form-builder/4.3.0/css/wforms-layout-ie6.css" rel="stylesheet" type="text/css" /> <![endif]--> <link href="https://www.tfaforms.com/themes/get/default" rel="stylesheet" type="text/css" /> <link href="https://www.tfaforms.com/form-builder/4.3.0/css/wforms-jsonly.css" rel="alternate stylesheet" title="This stylesheet activated by javascript" type="text/css" /> <script type="text/javascript" src="https://www.tfaforms.com/wForms/3.10/js/wforms.js"></script> <script type="text/javascript"> wFORMS.behaviors.prefill.skip = false; </script> <script type="text/javascript" src="https://www.tfaforms.com/wForms/3.10/js/localization-en_US.js"></script>
The page in question is here: http://www.vendini.com/gbi-form-original/
I found a number of threads about the proper syntax used to add scripts to the head of all pages, but I’m wondering how to add it to just one page?
Thanks,
JoanMarch 10, 2016 at 9:30 pm #833005Hi Joan,
Thanks for writing in!
If you want to add this code in the
<head>...</head>
section of your website, add following code in your Child Theme‘s functions.php file:function scripts_to_head() { if ( is_front_page() ) { ?> <!-- Add Your Scripts Here --> <?php } } add_action('wp_head', 'scripts_to_head');
Add your code below <!– Add Your Scripts Here –>. Note: This code will work only if you are using a static homepage. If you have set your blog page as your homepage, you will need to replace
is_front_page()
from the code withis_home()
.If you want it for other page than home page, then you need to replace is_front_page() with is_page()
function scripts_to_head() { if ( is_page( xx ) ) { ?> <!-- Add Your Scripts Here --> <?php } } add_action('wp_head', 'scripts_to_head');
Replace the xx with the actual page ID.
To manually enqueue a script on the <head> tag, you can copy the file _meta.php from the parent x folder \x\framework\views\global\ directory. And then paste that on \x-child\framework\views\global\ directory of your child theme.
Hope it explain better.
Cheers!
March 31, 2016 at 1:26 pm #861209That worked wonderfully! Thank you 🙂
March 31, 2016 at 9:45 pm #861836You are most welcome. 🙂
-
AuthorPosts