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 | |
/*----------------------------------------------------------------------------------- | |
TABLE OF CONTENTS | |
- Exclude categories from displaying on the "Blog" page template. | |
- Exclude categories from displaying on the homepage. | |
- Register WP Menus | |
- Breadcrumb display |
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 ( !class_exists( 'WP_Smart_Cache_v1' ) ) : | |
Class WP_Smart_Cache_v1 { | |
static $instances = array(); | |
public function __construct() { | |
if ( function_exists( 'wp_cache_add_global_groups' ) ) | |
wp_cache_add_global_groups( array( 'wp_smart_cache_global' ) ); | |
} |
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 | |
// Make sure required $_FILES values are set before trying to load WordPress | |
if ( isset( $_FILES['file'] ) ) { | |
// We don't need all of WordPress, just the basics | |
define( 'SHORTINIT', true ); | |
// Load WordPress | |
require( strstr( dirname( __FILE__ ), 'wp-content', true ) . 'wp-load.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
Index: classes/class-wc-countries.php | |
=================================================================== | |
--- classes/class-wc-countries.php (revision 799848) | |
+++ classes/class-wc-countries.php (working copy) | |
@@ -1,4 +1,30 @@ | |
<?php | |
+ | |
+class WC_Countries_Loader { | |
+ | |
+ private $instance; |
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 basic_wp_seo() { | |
global $page, $paged, $post; | |
$default_keywords = 'wordpress, plugins, themes, design, dev, development, security, htaccess, apache, php, sql, html, css, jquery, javascript, tutorials'; // customize | |
$output = ''; | |
// description | |
$seo_desc = get_post_meta($post->ID, 'mm_seo_desc', true); | |
$description = get_bloginfo('description', 'display'); | |
$pagedata = get_post($post->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 | |
/* | |
Template Name: Print Processing Orders :) | |
*/ | |
if (!is_user_logged_in() || !current_user_can('manage_options')) wp_die('This page is private.'); | |
?> | |
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
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 | |
// Place the following code in your theme's functions.php file | |
// override the quantity input with a dropdown | |
function woocommerce_quantity_input() { | |
global $product; | |
$defaults = array( | |
'input_name' => 'quantity', | |
'input_value' => '1', | |
'max_value' => apply_filters( 'woocommerce_quantity_input_max', '', $product ), |
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
/** | |
* Use WC 2.0 variable price format, now include sale price strikeout | |
* | |
* @param string $price | |
* @param object $product | |
* @return string | |
*/ | |
function wc_wc20_variation_price_format( $price, $product ) { | |
// Main Price | |
$prices = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', 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
CREATE OR REPLACE FUNCTION pnorm(z double precision) RETURNS double precision AS $$ | |
SELECT CASE | |
WHEN $1 >= 0 THEN 1 - POWER(((((((0.000005383*$1+0.0000488906)*$1+0.0000380036)*$1+0.0032776263)*$1+0.0211410061)*$1+0.049867347)*$1+1),-16)/2 | |
ELSE 1 - pnorm(-$1) | |
END; | |
$$ LANGUAGE SQL IMMUTABLE STRICT; |
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
import plotly.graph_objects as go | |
import pandas as pd | |
def serp_heatmap(df, num_domains=10, select_domain=None): | |
df = df.rename(columns={'domain': 'displayLink', | |
'searchTerms': 'keyword'}) | |
top_domains = df['displayLink'].value_counts()[:num_domains].index.tolist() | |
top_domains = df['displayLink'].value_counts()[:num_domains].index.tolist() | |
top_df = df[df['displayLink'].isin(top_domains) & df['displayLink'].ne('')] |
OlderNewer