'localhost/bugsy' is the local directory of the website inside the wamp folder
npm i browser-sync
$ browser-sync start --proxy 'localhost/bugsy' --files '**/*' --no-notify
| import {puppeteer} from 'puppeteer'; | |
| const browser = await puppeteer.launch(); | |
| const page = await browser.newPage(); | |
| await page.goto('http://devstaging1.jsabeta.com/'); | |
| const meta = await page.$eval("head > meta[name='robots']", element => element.content); |
| $(document).ready(() => { | |
| var panelists = document.getElementsByClassName("guest-name"); | |
| var i; | |
| for (i = 0; i < panelists.length; i++) { | |
| panelists[i].addEventListener("click", function() { | |
| this.classList.toggle("active"); | |
| var panel = this.nextElementSibling; | |
| if (panel.style.display === "block") { | |
| panel.style.display = "none"; |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>AlphaStar</title> | |
| <link href="https://fonts.googleapis.com/css?family=Montserrat:400,400i,600,700,900" rel="stylesheet"> | |
| <link rel="stylesheet" href="css/normalize.css"> | |
| <link rel="stylesheet" href="css/style.css"> </head> |
| //Add to functions.php | |
| <?php | |
| function add_number_of_cart_items() { | |
| global $woocommerce; | |
| $cart_count = $woocommerce->cart->cart_contents_count; | |
| ?> | |
| <script> | |
| var cartCount = <?php echo $cart_count; ?>; | |
| var node = document.createElement("span"); |
| function run_function_with_cf7_data($WPCF7_ContactForm) { | |
| $submission = WPCF7_Submission::get_instance(); | |
| if ( $submission ) { | |
| // $posted_data = $submission->get_posted_data(); | |
| $email = $submission->get_posted_data('your-email'); | |
| ob_start(); |
| /* | |
| * Send Notification if a CF7 Form fails | |
| */ | |
| function cf7_error_notifications() { ?> | |
| <script type="text/javascript"> | |
| document.addEventListener( 'wpcf7mailfailed', function( event ) { | |
| <?php | |
| wp_mail( 'youremail@gmail.com', 'Form Failed', 'CF7 Form failed to send', array('Content-Type: text/html; charset=UTF-8')); | |
| ?> |
| <?php | |
| /*Add CTA Wp Bakery Component*/ | |
| class VcHubspotCta extends WPBakeryShortCode { | |
| function __construct() { | |
| add_action( 'init', array( $this, 'create_shortcode' ), 999 ); | |
| add_shortcode( 'vc_hubspot_cta', array( $this, 'render_shortcode' ) ); | |
| } |
| /* | |
| * Register custom meta box on custom post type to show in wp rest api | |
| * | |
| * Custom post type must support 'custom-fields' and have the 'show_in_rest' parameter set to true | |
| */ | |
| //Custom post type is 'audio' and custom meta box is 'cloud_url' | |
| add_action( 'rest_api_init', function () { | |
| register_rest_field( 'audio', 'cloud_url', array( |
| <script> | |
| jQuery(function() { | |
| jQuery('.video-container').on('click', function(e) { | |
| e.preventDefault(); | |
| var iframe = j(this).find('iframe'); | |
| var url = iframe.attr('data-src'); | |
| var srcValue = iframe.attr('src'); | |
| if(srcValue == 'about:blank') { |