This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Inserting a Script into Start of WordPress Avada Theme Body | |
| // https://endurtech.com/insert-script-into-wordpress-body/ | |
| add_action( 'avada_before_body_content', 'GA4TAGMGR' ); | |
| function GA4TAGMGR() | |
| { | |
| echo '<!-- Google Tag Manager (noscript) --> | |
| <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-YOURMEASURMENTIDHERE" height="0" width="0" style="display:none;visibility:hidden;"></iframe></noscript> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Inserting a Script into WordPress Body | |
| // https://endurtech.com/insert-script-into-wordpress-body/ | |
| // wp_body_open action hook to inject a script | |
| add_action( 'wp_body_open', 'custom_body_scripts', 10 ); | |
| function custom_body_scripts() | |
| { | |
| echo '<script>alert( "This is triggered from within the body of your website." );</script>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Inserting a Script into WordPress Header | |
| // https://endurtech.com/insert-script-into-wordpress-header/ | |
| // wp_head action hook to inject a script | |
| add_action( 'wp_head', 'custom_header_scripts' ); | |
| function custom_header_scripts() | |
| { | |
| echo '<script>alert( "This is triggered from within the header of your website." );</script>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Call RewriteEngine if you haven't already done so | |
| RewriteEngine On | |
| RewriteBase / | |
| # Replace 1.2.3.4 with your IP Address and othersite.com. | |
| RewriteCond %{REMOTE_ADDR} !^1.2.3.4 | |
| RewriteRule .* https://othersite.com [R=302,L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Restrict server access by IP address. Separate multiple addresses with a space. | |
| # This example uses xxx as IP 1 and yyy as IP 2. | |
| <RequireAll> | |
| Require ip xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy | |
| </RequireAll> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // update the number '1' to the ID number on your form | |
| // https://endurtech.com/create-read-only-field-in-gravityforms/ | |
| add_filter( 'gform_pre_render_1', 'add_readonly_script' ); | |
| function add_readonly_script( $form ) | |
| { | |
| ?><script type="text/javascript">jQuery(document).ready(function() { jQuery("li.gf_readonly input[type=checkbox]").attr("onclick","return false;"); });</script><?php | |
| return $form; | |
| } | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // update the number '1' to the ID number on your form | |
| // https://endurtech.com/create-read-only-field-in-gravityforms/ | |
| add_filter( 'gform_pre_render_1', 'add_readonly_script' ); | |
| function add_readonly_script( $form ) | |
| { | |
| ?><script type="text/javascript">jQuery(document).ready(function() { jQuery("li.gf_readonly input").attr("readonly","readonly"); });</script><?php | |
| return $form; | |
| } | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // update the number '1' to the ID number on your form | |
| // https://endurtech.com/create-read-only-field-in-gravityforms/ | |
| add_filter( 'gform_pre_render_1', 'add_readonly_script' ); | |
| function add_readonly_script( $form ) | |
| { | |
| ?><script type="text/javascript">jQuery(document).ready(function() { jQuery("li.gf_readonly textarea").attr("readonly","readonly"); });</script><?php | |
| return $form; | |
| } | |
| ?> |