Resources
Code — Scrolling
Add Class when Element scrolls into View
function isScrolledIntoView(elem) { if (elem.length) { var docViewTop = $(window).scrollTop(); var docViewBottom = docViewTop + $(window).height(); var elemTop = $(elem).offset().top - 300; var elemBottom = elemTop + $(elem).height(); return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop)); } } if (isScrolledIntoView($('.site-footer'))) { $('body').addClass('footer-visible'); } else { $('body').removeClass('footer-visible'); }
Shopify — Code — Shopify Code
How to add fonts to a Shopify site
Make it a fonts.scss.liquid and then add {{ ‘fonts.scss.css’ | asset_url | stylesheet_tag }} to theme.liquid
Example of formatting:
@font-face { font-family: 'BeausiteGrandThin'; src: url('BeausiteGrandThin.eot'); src: url('BeausiteGrandThin.eot') format('embedded-opentype'), url('BeausiteGrandThin.woff2') format('woff2'), url('BeausiteGrandThin.woff') format('woff'), url('BeausiteGrandThin.ttf') format('truetype'), url('BeausiteGrandThin.svg#BeausiteGrandThin') format('svg'); }
CodeSearch Results by Relevance instead of Post Date
add_filter('relevanssi_orderby', 'rlv_fix_order');
function rlv_fix_order($orderby) {
$orderby = "relevance";
return $orderby;
}
CodeScreenshots to be JPG instead of PNG
Type into Terminal:
defaults write com.apple.screencapture type jpg;killall SystemUIServer
CodeEmail Signature
<table style="font-size: 12.8px; font-family: times;">
<tbody><tr><td><a href="http://mckenziesuemakes.com/" target="_blank">
<img src="http://mckenziesue.engine.com/wp-content/themes/mckenziesue-basetheme/img/[email protected]" width="250"" style="float: left; padding-right: 15px; padding-bottom: 15px;"></a>
<p style="padding-left: 0px; margin-top: 0px; font-family: lato, sans-serif; margin-bottom: 0px; font-size: 7px; letter-spacing: 1px;"><a style="color: black;">MCKENZIE SUE RUCKER<br>
<br>PH: 509.855.2557<br><br>[email protected]</a></p></td></tr></tbody></table>
CodeIf WordPress max file-size is too low
*Caution: You should not edit this file if you are not confident in the code. You shouldn’t really change the upload_max_filesize for purposes other than importing.
Code_____@_______.com.test-google-a.com
When Contact Form 7 does not send to a Gmail email for some reason, add .test-google-a.com to the end and it may help. I learned this trick from a Google support agent and it has worked every time. You will want to also download the ‘Contact Form 7 Submissions’ to make sure any submissions don’t get lost between your site and your email inbox.