Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Joseph VanTine thebigtine

🏠
Working from home
View GitHub Profile
View calculator-button.php
<?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
});
View max-upload-size.php
<?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;
View flexslider-always-show-arrows.css
.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 */
}
View hide-menu-for-single-user.php
<?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;
View equalHeight.js
jQuery(document).ready(function($) {
let selector = $( '.selector' )
// Get an array of all element heights
var elementHeights = selector.map( function() {
return $( this ).height();
}).get()
// Math.max takes a variable number of arguments
View edit-host-file.bash
# open host file
sudo nano /private/etc/hosts
# clear DNS cache
dscacheutil -flushcache;sudo killall -HUP mDNSResponder
View gitignore-for-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/
View clean-up-wordpress.php
<?
function tf_cleanup() {
// EditURI link
remove_action( 'wp_head', 'rsd_link' );
// windows live writer
remove_action( 'wp_head', 'wlwmanifest_link' );
// previous link
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );
// start link
@thebigtine
thebigtine / .htaccess
Last active Dec 20, 2018
Wordpress .htaccess file
View .htaccess
# 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 Nov 23, 2018
WordPress MultiSite infinit redirect
View .htaccess
# 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]