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
function modify_jquery() { | |
if (!is_admin()) { | |
wp_deregister_script('jquery'); | |
wp_register_script('jquery', 'https://code.jquery.com/jquery-1.11.3.min.js'); | |
wp_enqueue_script('jquery'); | |
} | |
} | |
add_action('init', 'modify_jquery'); |
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 | |
add_action( 'woocommerce_single_product_summary', 'custom_pdf_catalog_download_button' ); | |
function custom_pdf_catalog_download_button() { | |
return do_shortcode( '[wc-store-catalog-pdf]' ); | |
} |
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( 'wcpv_shortcode_registration_form_validation', 'wc_custom_vendors_validation', 10, 2 ); | |
function wc_custom_vendors_validation( $errors, $form_items ) { | |
if ( empty( $form_items['vendor_description'] ) ) { | |
$errors[] = __( 'Vendor Description is a required field.', 'woocommerce-product-vendors' ); | |
} | |
return $errors; | |
} |
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( 'get_header', 'remove_storefront_sidebar' ); | |
function remove_storefront_sidebar() { | |
if ( is_woocommerce() ) { | |
remove_action( 'storefront_sidebar', 'storefront_get_sidebar', 10 ); | |
} | |
} |
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
body.woocommerce #primary { | |
float: none; | |
width: 100%; | |
} |
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
function wcs_redirect_product_based ( $order_id ){ | |
$order = wc_get_order( $order_id ); | |
foreach( $order->get_items() as $item ) { | |
$_product = wc_get_product( $item['product_id'] ); | |
// Add whatever product id you want below here | |
if ( $item['product_id'] == 70 ) { | |
// change below to the URL that you want to send your customer to | |
wp_redirect('http://www.yoururl.com/your-thank-you-page'); | |
} |
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
// Difference for between now and a date in the future | |
$future_timestamp = strtotime( '1st January 2020' ); | |
$difference = human_time_diff( current_time( 'timestamp' ), $future_timestamp ); | |
// Difference between a date in the past and now | |
$past_timestamp = strtotime( '1st January 2016' ); | |
$difference = human_time_diff( $past_timestamp, current_time( 'timestamp' ) ); |
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 | |
/* | |
Plugin Name: Example Scheduled Events | |
Plugin URI: https://wordpress.org/ | |
Description: This is an example plugin to learn how to use scheduled events | |
Version: 1.0.0 | |
Author: Your Name | |
Author URI: https://yoursite.com | |
Text Domain: egse | |
*/ |
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
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> | |
<header class="entry-header"> | |
<?php | |
$original_url = get_post_meta( get_the_id(), '_wpcom-crosspost-original_url', true ); | |
$url = ! empty( $original_url ) ? $original_url : get_permalink(); | |
if ( is_single() ) { | |
storefront_posted_on(); | |
?> | |
<span class="posted-on"><?php printf( __( 'at <a href="%s" rel="bookmark">%s</a>', 'storefront' ), esc_url( $url ), parse_url( $url, PHP_URL_HOST ) ); ?></span> |
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
/** | |
* Post format Link | |
*/ | |
.hentry.type-post.format-link .entry-header { | |
margin-bottom: 5px; | |
} | |
.hentry.type-post.format-link .entry-title { | |
font-size: 1.618em !important; | |
} |