Skip to content

Instantly share code, notes, and snippets.

View freelancedaddytv's full-sized avatar

Freelance Daddy TV freelancedaddytv

View GitHub Profile
@freelancedaddytv
freelancedaddytv / gist:9442ab94f6ceedb6fccfd04b09fcddc8
Created March 3, 2022 08:59
Get Product SKU in Woocommerce Wordpress Functions.PHP
$type = $product->product_type;
$sku = $type == 'simple' ? $product->get_sku() : '';
echo $sku;
@freelancedaddytv
freelancedaddytv / common spam words 2020
Created January 22, 2022 06:55 — forked from prasidhda/common spam words 2020
List of common spam words
0%
0% risk
777
99%
99.9%
100%
100% more
#1
$$$
100% free
@freelancedaddytv
freelancedaddytv / divibuilder-cptype.php
Created June 14, 2018 21:10
Enable Divi Builder on All Custom Post Type
// paste the code in divi functions.php or upload this file on wp-contents/mu-plugins
function divi_wp_post_types( $custom_post_types ) {
$custom_post_types = get_post_types();
if ( $custom_post_types ) {
foreach ( $custom_post_types as $custom_post_type ) {
@freelancedaddytv
freelancedaddytv / index.php
Created May 10, 2018 20:28
Github Sample
<?php
echo 'Hello World';
?>
@freelancedaddytv
freelancedaddytv / flip.js
Created April 29, 2018 22:09
Genesis Flipping Column Custom Post Type Loop
$('.flipboard').hover(function(e) {
$(this).find('.card').toggleClass('flipped');
});
@freelancedaddytv
freelancedaddytv / style.css
Created February 21, 2018 22:01
Perfect Simple Full Width Background Inside Container
.yourelement {
background-image:url('yourimage.jpg'); // Use background-color for background color
background-position: center center;
background-size: cover;
background-repeat: no-repeat;
width: 100vw;
position: relative;
margin-left: -50vw;
left: 50%;
}
@freelancedaddytv
freelancedaddytv / prefix-price.php
Created November 11, 2017 14:15
Add Prefix To Woocommerce Price
add_filter( 'woocommerce_get_price_html', 'woo_prefix_text', 100, 2 );
function woo_prefix_text( $price, $product ){
/* Change FROM word to any text you want */
$price = 'FROM ' . $price ;
return apply_filters( 'woocommerce_get_price', $price );
}
@freelancedaddytv
freelancedaddytv / html
Created October 25, 2017 15:11
Responsive Youtube with External Toggle Mute and UnMute Sound
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<style>
.videoWrapper {
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: 0;
}
@freelancedaddytv
freelancedaddytv / remove_img_link.php
Created May 30, 2017 07:09
Woocommerce 3.0 + Remove Single Product Main Image Link
@freelancedaddytv
freelancedaddytv / functions.php
Created August 9, 2015 15:26
WooCommerce ShortCode Sort by Price
/* Add this to functions.php */
add_filter( 'woocommerce_shortcode_products_query', 'woocommerce_shortcode_products_orderby' );
function woocommerce_shortcode_products_orderby( $args ) {
$standard_array = array('menu_order','title','date','rand','id');
if( isset( $args['orderby'] ) && !in_array( $args['orderby'], $standard_array ) ) {
$args['meta_key'] = '_price';
$args['orderby'] = 'meta_value_num';