Skip to content

Instantly share code, notes, and snippets.

View thebigtine's full-sized avatar
🏠
Working from home

Joseph VanTine thebigtine

🏠
Working from home
View GitHub Profile
@thebigtine
thebigtine / google-tracking-code.js
Created August 10, 2022 12:57
Shopify Google tracking code
gtag("event", "purchase", {
transaction_id: "{{ order.order_number }}",
affiliation: "Google Merchandise Store",
value: {{ total_price | times: 0.01 }},
tax: {{ tax_price | times: 0.01 }},
shipping: {{ shipping_price | times: 0.01 }},
currency: "{{ order.currency }}",
coupon: "{{ order.discount_application.title }}", // needs testing
items: [
{% for line_item in line_items %}{
<?php
function after_buttons() {
echo '<a id="yacht_finanz_calc_button" href="#yacht_finanz_calc" class="btn btn-primary btn-lg btn-block anchor-scroll">Finanzierung</a>';
echo "<script>
jQuery('#yacht_finanz_calc_button').click(function() {
jQuery('.listing-accordion > .listing-details-grid').not( jQuery('#yacht_finanz_calc').next('.listing-details-grid') ).slideUp()
jQuery('#yacht_finanz_calc').next('.listing-details-grid').slideDown()
return false
});
.flexslider .flex-direction-nav .flex-next {
right: 5px; /* adjust offset to match the hover style */
opacity: .8; /* adjust opacity to match the hover style */
}
.flexslider .flex-direction-nav .flex-prev {
left: 5px; /* adjust offset to match the hover style */
opacity: .8; /* adjust opacity to match the hover style */
}
<?php
// add class to admin body tag
function add_body_classes( $classes ) {
$current_user = wp_get_current_user();
// Right: Add a leading space and a trailing space.
$classes .= ' current-user-' . $current_user->ID . ' ';
return $classes;
<?php
/**
* Filter the upload size limit for non-administrators.
*
* @param string $size Upload size limit (in bytes).
* @return int (maybe) Filtered size limit.
*/
function filter_site_upload_size_limit( $size ) {
$size = 60 * 1024 * 1024;
return $size;
# open host file
sudo nano /private/etc/hosts
# clear DNS cache
dscacheutil -flushcache;sudo killall -HUP mDNSResponder
@thebigtine
thebigtine / gitignore-for-wordpress-theme
Created May 10, 2019 10:26 — forked from jasewarner/gitignore-for-wordpress-theme
.gitignore for a WordPress theme
# ignore everything in the root except the "wp-content" directory.
/*
!wp-content/
# ignore everything in the "wp-content" directory, except:
# mu-plugins, plugins, and themes directories
wp-content/*
!wp-content/mu-plugins/
!wp-content/plugins/
!wp-content/themes/
@thebigtine
thebigtine / .htaccess
Last active December 20, 2018 17:00
Wordpress .htaccess file
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
@thebigtine
thebigtine / .htaccess
Last active November 23, 2018 16:50
WordPress MultiSite infinit redirect
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
<?php
/*
* get the abbreviated language code from get_locale()
*/
public function get_locale_abbr() {
return strtok( get_locale(), "_" );
}