Skip to content

Instantly share code, notes, and snippets.

@jessbudd
jessbudd / 30th Anniversary Fete v1.markdown
Last active April 3, 2016 03:37
30th Anniversary Fete v1

30th Anniversary Fete v1

A website created for the 30th Anniversary Fete for a local Primary School.

A Pen by FeralFP on CodePen.

License.

@jessbudd
jessbudd / 30th Anniversary Fete v2.markdown
Last active April 3, 2016 11:07
30th Anniversary Fete v2
@jessbudd
jessbudd / gist:66335479ac69391e038d85dfc95e94a4
Created December 21, 2017 05:59
Woocoomerce product loop
<?php
$args = array(
'post_type' => 'product',
'stock' => 1,
'posts_per_page' => 4, //how many products to show
'tax_query' => array( //query the product catagories
array(
'taxonomy' => 'product_cat',
'field' => 'slug',
@jessbudd
jessbudd / gist:66232f577743fd5fa1b542c48b102f20
Created December 21, 2017 06:18
Woocommerce best selling product loop
<?php
$args = array(
'post_type' => 'product',
'stock' => 1,
'posts_per_page' => 4,
'meta_key' => 'total_sales',
'orderby' => 'meta_value_num',
'tax_query' => array( //do not return results from this category
array(
'taxonomy' => 'product_cat',
// remove Google Maps JS/CSS from the homepage
add_action( 'wp_print_scripts', 'maps_deregister_javascript', 100 );
function maps_deregister_javascript() {
if ( is_front_page() ) {
wp_deregister_script( 'wpgmp-google-api' );
wp_deregister_script( 'wpgmp-frontend' );
wp_deregister_script( 'wpgmp-google-map-main' );
Add this code block to php file:
// Add Backorder text to woocommerce images that are backordered products
function ff_add_backorder_badge() {
global $product;
if($product->stock !== '' && $product->stock <= 0) {
echo '<span class="out-of-stock">Backorder</span>';
}
}
Add html to "Before Header Content" in GP Hooks
<div class="new-site-logo">
<a href="https://hbdsalon.com.au/" title="HBD Salon" rel="home">
<img class="header-image" alt="HBD Salon" src="https://hbdsalon.com.au/wp-content/uploads/2018/02/HBD_Salon_Logo-e1518063893509.jpg" title="HBD Salon" srcset="https://hbdsalon.com.au/wp-content/uploads/2018/02/HBD_Salon_Logo-e1518063893509.jpg 1x, https://hbdsalon.com.au/wp-content/uploads/2018/02/HBD_Salon_Logo_1408.png 2x" width="3508" height="1069">
</a>
</div><!--site-logo-->
<div class="header-contact">
<p class="header-phone">93909387</p>
<a href="#">Book Appointment</a>
Add this codeblock to your functions.php file:
add_filter('widget_text','execute_php',100);
function execute_php($html){
if(strpos($html,"<"."?php")!==false){
ob_start();
eval("?".">".$html);
$html=ob_get_contents();
ob_end_clean();
}
Go to Control Panel
Go to PHPMyadmin
Select appropriate Database
Click on SQL in top bar
Enter in below code (change username, password, name and email)
@jessbudd
jessbudd / gist:1a65c1d57a0e017cdb0c945b50ec14a3
Created August 18, 2019 04:41
Move product tabs beside the product image - woocommerce
credit: https://businessbloomer.com/woocommerce-move-product-tabs-short-description/
/**
* @snippet Move product tabs beside the product image - WooCommerce
* @how-to Watch tutorial @ https://businessbloomer.com/?p=19055
* @sourcecode https://businessbloomer.com/?p=393
* @author Rodolfo Melogli
* @testedwith WooCommerce 3.5.2
* @donate $9 https://businessbloomer.com/bloomer-armada/
*/