This file contains 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
var path = require('path'); | |
var webpack = require('webpack'); | |
module.exports = { | |
devtool: 'eval', | |
entry: [ | |
'webpack-dev-server/client?http://localhost:3000', | |
'webpack/hot/only-dev-server', | |
'./src/index' | |
], |
This file contains 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
/* | |
## Device = Desktops | |
## Screen = 1281px to any higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
//CSS | |
} |
This file contains 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
// Make sure to replace `username`, `password`, `first_name`, `last name` & `email` with your desired data. | |
INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`) | |
VALUES ('NEW_USERNAME', MD5('NEW_PASSWORD'), 'FIRST_NAME LAST_NAME', '[email protected]', '0'); | |
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) | |
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}'); | |
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) | |
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_user_level', '10'); |
This file contains 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
// Display Fields | |
add_action( 'woocommerce_product_options_general_product_data', 'woo_add_custom_general_fields' ); | |
// Save Fields | |
add_action( 'woocommerce_process_product_meta', 'woo_add_custom_general_fields_save' ); |
This file contains 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 | |
function woo_add_custom_general_fields() { | |
global $woocommerce, $post; | |
echo '<div class="options_group">'; | |
// Number Field | |
woocommerce_wp_text_input( | |
array( |
This file contains 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 | |
function woo_add_custom_general_fields_save( $post_id ){ | |
// Text Field | |
$woocommerce_text_field = $_POST['_text_field']; | |
if( !empty( $woocommerce_text_field ) ) | |
update_post_meta( $post_id, '_text_field', esc_attr( $woocommerce_text_field ) ); | |
// Number Field | |
$woocommerce_number_field = $_POST['_number_field']; |
This file contains 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 | |
<?php | |
// Display Custom Field Value | |
echo get_post_meta( $post->ID, 'my-field-slug', true ); | |
// You can also use | |
echo get_post_meta( get_the_ID(), 'my-field-slug', true ); | |
?> |
This file contains 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
/** | |
* Return value if the current location has a query string. | |
* | |
* @params {string} lookUpString - The query string to search for. | |
* @returns {string} value of the query string if present. | |
* | |
* Example: getValueIfHasQueryString("v") <= "2" | |
**/ | |
function getValueIfHasQueryString(lookUpString) { | |
const url = new URL(window.location.href); |
This file contains 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
var adUnit = document.getElementsByClassName("section-below-title")[0]; | |
var parentElement = adUnit.childNodes[0]; | |
// Create script element | |
var script = document.createElement('script'); | |
script.async = true; | |
script.src = "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"; | |
parentElement.appendChild(script); | |
// Create INS element |