This file contains hidden or 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
<IfModule mod_headers.c> | |
<FilesMatch "\.(txt|xml|js)$"> | |
Header set Cache-Control "max-age=31536000" | |
</FilesMatch> | |
<FilesMatch "\.(css)$"> | |
Header set Cache-Control "max-age=31536000" | |
</FilesMatch> | |
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac)$"> |
This file contains hidden or 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
// Totally disable comments functionality | |
function lp_disable_comments_post_types_support() { | |
$post_types = get_post_types(); | |
foreach ( $post_types as $post_type ) { | |
if ( post_type_supports( $post_type, 'comments' ) ) { | |
remove_post_type_support( $post_type, 'comments' ); | |
remove_post_type_support( $post_type, 'trackbacks' ); | |
} | |
} | |
} |
This file contains hidden or 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
# ----------------------------------------------------------------- | |
# .gitignore for WordPress | |
# Bare Minimum Git | |
# http://ironco.de/bare-minimum-git/ | |
# ver 20150227 | |
# | |
# This file is tailored for a WordPress project | |
# using the default directory structure | |
# | |
# This file specifies intentionally untracked files to ignore |
This file contains hidden or 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
// Ajaxify loading resources | |
function ajax_load_cases(){ | |
$al_id = $_POST['id']; | |
$al_type = $_POST['type']; | |
$al_args = array( | |
'p' => $al_id, | |
'post_type' => $al_type, | |
'posts_per_page' => -1 | |
); | |
$al_query = new WP_Query( $al_args ); ?> |
This file contains hidden or 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('init', 'add_countries', 100); | |
function add_countries() { | |
$country_array = array( | |
$countries = array( | |
"AF" => "Afghanistan", | |
"AL" => "Albania", | |
"DZ" => "Algeria", | |
"AS" => "American Samoa", | |
"AD" => "Andorra", |
This file contains hidden or 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 change_yoast_seo_og_meta() { | |
add_filter( 'wpseo_opengraph_desc', 'change_desc' ); | |
} | |
function change_desc( $desc ) { | |
// This article is actually a landing page for an eBook | |
if( is_singular( 123 ) ) { |
This file contains hidden or 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 (is_order_received_page()) { | |
$order_id = wc_get_order_id_by_order_key( $_GET['key'] ); | |
$order = wc_get_order( $order_id ); | |
$cookie_name = "order_data_sent"; | |
$cookie_value = $order_id; | |
$transaction_id = ($order->transaction_id ? $order->transaction_id : $order_id); | |
$total = $order->total; | |
$total_tax = $order->total_tax; | |
$shipping_method = @array_shift($order->get_shipping_methods()); |