Element -- selects all h2
elements on the page
h2 {
foo: bar;
//Add a stylesheet after default style.css | |
wp_enqueue_style( 'my-css', get_template_directory_uri() . 'my-css.css', array('themename-style')); | |
//WooCommerce - Sort products by SKU | |
add_filter('woocommerce_get_catalog_ordering_args', 'custom_woocommerce_catalog_orderby'); | |
function custom_woocommerce_catalog_orderby( $args ) { | |
$args['meta_key'] = '_sku'; | |
$args['orderby'] = 'meta_value'; | |
$args['order'] = 'asc'; | |
return $args; |
function init_pmpro_membership_content_filter_later() | |
{ | |
remove_filter('the_content', 'pmpro_membership_content_filter', 5); | |
remove_filter('the_content_rss', 'pmpro_membership_content_filter', 5); | |
remove_filter('comment_text_rss', 'pmpro_membership_content_filter', 5); | |
add_filter('the_content', 'pmpro_membership_content_filter', 15); | |
add_filter('the_content_rss', 'pmpro_membership_content_filter', 15); | |
add_filter('comment_text_rss', 'pmpro_membership_content_filter', 15); | |
} |
<?php | |
/** | |
* Plugin Name: WooCommerce Upsells Shortcode | |
* Plugin URI: http://skyver.ge/51 | |
* Description: Adds a shortcode to output WooCommerce product upsells; removes them from the original location when used | |
* Author: SkyVerge | |
* Author URI: https://www.skyverge.com/ | |
* Version: 1.0.0 | |
* | |
* Copyright: (c) 2016 SkyVerge, Inc. ([email protected]) |
<?php | |
Give me one record | |
$queryFilms = "SELECT filmName, filmDescription FROM movies WHERE filmID = 10"; | |
$resultFilms = $mysqli->query($queryFilms); | |
$rowFilms = $resultFilms->fetch_assoc(); | |
// then to output | |
echo "<p>{$rowFilms['filmName']}</p>"; | |
// Remove Links to WooCommerce Single Product Page | |
remove_action( 'woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10 ); | |
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5 ); |
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
//CSS | |
<?php | |
//increase max execution time of this script to 150 min: | |
ini_set('max_execution_time', 9000); | |
//increase Allowed Memory Size of this script: | |
ini_set('memory_limit','960M'); | |
// Copies woocommerce orders and users over from source to target. | |
// I use this on my local machine - loading both db's up there side by side | |
// could easily adjust the connect strings to connect elsewhere if needed. |
<?php | |
/** | |
* After adding this code to theme functions.php, ensure you clear transients via WC > System Status > Tools | |
*/ | |
add_filter( 'woocommerce_get_sale_price', '__return_empty_string' ); | |
add_filter( 'woocommerce_variation_prices_sale_price', '__return_empty_string' ); | |
add_filter( 'woocommerce_variation_prices_price', 'custom_get_price', 10, 2 ); | |
add_filter( 'woocommerce_get_price', 'custom_get_price', 10, 2 ); |
<?php | |
/** | |
* Outputs a rasio button form field | |
*/ | |
function woocommerce_form_field_radio( $key, $args, $value = '' ) { | |
global $woocommerce; | |
$defaults = array( | |
'type' => 'radio', | |
'label' => '', |