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 | |
add_action('wp_ajax_envialosimple_member_edit', function() { | |
// Get the results | |
$baseURL = 'https://app.envialosimple.com'; | |
$apiKey = ''; | |
$remote_url = $baseURL . '/member/edit/format/json'; | |
$params = 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 | |
// Ensure cart contents update when products are added to the cart via AJAX (place the following in functions.php) | |
add_filter( 'woocommerce_add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment' ); | |
function woocommerce_header_add_to_cart_fragment( $fragments ) { | |
ob_start(); | |
?> | |
<a class="cart-contents" href="<?php echo WC()->cart->get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php echo sprintf (_n( '%d item', '%d items', WC()->cart->cart_contents_count ), WC()->cart->cart_contents_count ); ?> - <?php echo WC()->cart->get_cart_total(); ?></a> | |
<?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
# BEGIN WP_Ajax alias | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteRule ^alias.php$ wp-admin/admin-ajax.php?%{QUERY_STRING} [L] | |
</IfModule> | |
# BEGIN WP_Ajax alias |
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 | |
add_filter('posts_search', function ($search, &$wp_query) { | |
global $wpdb; | |
if (empty($search) || is_admin()) { | |
return $search; // skip processing - no search term in query | |
} | |
$s = get_query_var('s'); |
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
/* Sorurce: http://codepen.io/Rowno/pen/Afykb */ | |
.carousel-fade { | |
.carousel-inner { | |
.item { | |
transition-property: opacity; | |
} | |
.item, | |
.active.left, | |
.active.right { |
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
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl'); |
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
<form class="col-sm-6" action="<?php echo admin_url('admin-ajax.php') ?>" method="post"> | |
<?php | |
$poll = current(get_posts('post_type=poll&posts_per_page=1')); | |
$poll_options = (array) get_post_meta($poll->ID, '_poll_options', TRUE); | |
?> | |
<input type="hidden" name="poll_id" value="<?php echo $poll->ID ?>"> | |
<input type="hidden" name="action" value="user_poll_vote"> | |
<?php wp_nonce_field('user_poll_vote') ?> |
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
# ---------------------------------------------------------------------- | |
# WORDPRESS HTACCESS FIREWALL | |
# @ http://codex.wordpress.org/Hardening_WordPress | |
# ---------------------------------------------------------------------- | |
# ---------------------------------------------------------------------- | |
# DISABLE DIRECTORY BROWSING | |
# ---------------------------------------------------------------------- | |
Options All -Indexes |
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 | |
add_post_type_support( 'post', 'page-attributes' ); | |
add_action( 'init', function() { | |
global $wp_post_types; | |
$wp_post_types['post']->hierarchical = true; | |
}, 99 ); |
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
## Block any attempted XML-RPC requests | |
<Files xmlrpc.php> | |
order deny,allow | |
deny from all | |
## allow from 123.123.123.123 | |
</Files> |