<button>Let's Go !</button>
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
/** | |
* Restricts which products can be added to the cart at the same time. Tested | |
* with WooCommerce up to version 2.5. | |
* | |
* HOW TO USE THIS CODE | |
* 1. Add the code to the bottom of your theme's functions.php file (see https://www.skyverge.com/blog/add-custom-code-to-wordpress/). | |
* 2. Set the IDs of the products that are allowed to be added to the cart at the same time. | |
* 3. Amend the message displayed to customers when products are unavailable after the specified | |
* products have been added to the cart (see function woocommerce_get_price_html(), below). | |
* |
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 a custom body class for a specific page template | |
* Add the following to your theme functions.php file. | |
*/ | |
add_filter( 'body_class', 'custom_class' ); | |
function custom_class( $classes ) { | |
if ( is_page_template( 'templates/page-contact.php' ) ) { | |
$classes[] = 'contact'; | |
} |
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
/** | |
* Displays product attributes in the top right of the single product page. | |
* | |
* @param $product | |
*/ | |
function display_attributes( $product ) { | |
global $product; | |
global $post; | |
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 in your functions.php */ | |
add_action('wp_logout','auto_redirect_after_logout'); | |
function auto_redirect_after_logout(){ | |
wp_redirect( home_url() ); | |
exit(); | |
} |
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 JUNK FROM HEAD | |
// ========================================================================= | |
remove_action('wp_head', 'rsd_link'); // remove really simple discovery link | |
remove_action('wp_head', 'wp_generator'); // remove wordpress version | |
remove_action('wp_head', 'feed_links', 2); // remove rss feed links (make sure you add them in yourself if youre using feedblitz or an rss service) | |
remove_action('wp_head', 'feed_links_extra', 3); // removes all extra rss feed links | |
remove_action('wp_head', 'index_rel_link'); // remove link to index page |
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
/** | |
* Disable the emoji's | |
*/ | |
function disable_emojis() { | |
remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); | |
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); | |
remove_action( 'wp_print_styles', 'print_emoji_styles' ); | |
remove_action( 'admin_print_styles', 'print_emoji_styles' ); | |
remove_filter( 'the_content_feed', 'wp_staticize_emoji' ); | |
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); |
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_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 ); | |
add_action( 'woocommerce_single_product_summary', 'my_woocommerce_template_single_rating', 10 ); | |
function my_woocommerce_template_single_rating() { | |
global $product; | |
if ( $product->post->comment_status === 'open' ) | |
wc_get_template( 'single-product/rating.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
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro | |
# | |
WP_OWNER=changeme # <-- wordpress owner | |
WP_GROUP=changeme # <-- wordpress group | |
WP_ROOT=/home/changeme # <-- wordpress root directory |
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 ( ! defined( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly | |
} | |
/** | |
* Login | |
*/ | |
class Custom_CPF_Login { |