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 | |
/********* Woocommerce Simple / Variable Product Discount (Saving Amount or Percentage) *********/ | |
/* | |
* Depeding on your product type (SIMPLE or VARIABLE) and the DISCOUNT type you prefer to be displayed under the price | |
(SAVED AMOUNT or SAVING PERCENTAGE), simply choose the proper code snippet as follows and add to your theme's functions.php. | |
*/ |
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
/** | |
* Remove Quantity Selector for All Products | |
*/ | |
function wc_remove_all_quantity_fields( $return, $product ) { | |
return true; | |
} | |
add_filter( 'woocommerce_is_sold_individually', 'wc_remove_all_quantity_fields', 10, 2 ); |
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
function my_post_image_html( $html, $post_id, $post_image_id ) { | |
if(is_single()) { | |
return ''; | |
} else | |
return $html; | |
} | |
add_filter( 'post_thumbnail_html', 'my_post_image_html', 10, 3 ); |
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
class FLHM_HTML_Compression | |
{ | |
protected $flhm_compress_css = true; | |
protected $flhm_compress_js = true; | |
protected $flhm_info_comment = true; | |
protected $flhm_remove_comments = true; | |
protected $html; | |
public function __construct($html) | |
{ | |
if (!empty($html)) |
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
add_action( 'woocommerce_single_product_summary', 'wp_product_sold_count', 11 ); | |
function wp_product_sold_count() { | |
global $product; | |
$total_sold = $product->get_total_sales(); | |
if ( $total_sold ) | |
echo '' . sprintf( __( 'Total Sales: %s', 'woocommerce' ), $total_sold ) . ''; | |
} |
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
function enableContextMenu(aggressive = true) { | |
void (document.ondragstart = null); | |
void (document.onselectstart = null); | |
void (document.onclick = null); | |
void (document.onmousedown = null); | |
void (document.onmouseup = null); | |
void (document.body.oncontextmenu = null); | |
enableRightClickLight(document); | |
if (aggressive) { | |
enableRightClick(document); |
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
{ | |
"log": { | |
"access": "", | |
"error": "", | |
"loglevel": "warning" | |
}, | |
"inbounds": [ | |
{ | |
"tag": "socks", | |
"port": 10808, |
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 | |
$this_server_real_ip_address = ""; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, "https://api.ipify.org"); //or replace the URL with https://www.showmyip.com/ | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
$this_server_real_ip_address = curl_exec($ch); | |
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 | |
if (function_exists('exec')) { | |
$ip_from_exec = exec('hostname -i'); | |
echo "IP Address (via exec): $ip_from_exec"; | |
} else { | |
echo "exec() function is not enabled on this server."; | |
} | |
?> |
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
<!-- | |
First, create an Elementor section/container and set its CSS id as #lottie. | |
Then, add an HTML block below it and copy/paste the following code. | |
Upload your Lottie JSON file to the WordPress library and replace "path-to-lottie-file" in the code with the file URL. | |
--> | |
<style> | |
#lottie { | |
position: relative; | |
} |
OlderNewer