Web Dev
Adding PDF Files to Shopify Pages
I’ve had to add pdf files to pages within the shopify platform several times now, and I always seem to forget how to do it. I generally don’t have a problem uploading them (if I’m going through the edit template area), but I can never figure out how to get the URL for the PDF […]
Read MoreInserting a PSD into another PSD File
For the longest time I’ve been waiting for the ability to insert a Photoshop file into another Photoshop file. I think the capability has actually been around for quite some time, but up until recently I was using an older version of Photoshop, mainly out of protest of the subscription fee business plan that Adobe […]
Read MoreLogo List Functionality
Creates a list of image logos, ideally spaced and responsive. Image Examples Image example Including the File (WordPress) require_once(get_template_directory().”/saphire-blocks/logo-list/logo-list.php”); Using the Function <?php $data[‘Title’] = “Section Title Here”; $data[‘Image’][0][‘Image’] = “image-path.jpg”; $data[‘Image’][0][‘ImageTarget’] = “some-website.com”; $data[‘Image’][0][‘ImageAltText’] = “Image Alternate Text”; $data[‘Image’][1][‘Image’] = “image-path.jpg”; $data[‘Image’][1][‘ImageTarget’] = “some-website.com”; $data[‘Image’][1][‘ImageAltText’] = “Image Alternate Text”; Saphire_LogoList($data); ?> Settings $data[‘BackgroundColor’] Adds […]
Read MoreStandard Section Functionality
This functionality simplifies the process of creating a “standard section” on a website (it can also be used to create a hero section), where there is a block of text and an image. The image can aligned to the left, right, or bottom, and this has many additional features to make creating pages easier. The […]
Read MoreOn-Page SEO Checklist
Content is of high quality, aim for main content to be at least 500 words Keywords included in page title (meta title tag) Keywords located in page url Keywords included in page headline (h1 tag) Keywords included in at least one h2 tag Keywords repeated 3-6 times within the body text All images have alt […]
Read MoreReference a Variable Outside of a Handlebars Each Loop
Once within an Handlebars each loop, you can no longer just reference a variable that is outside the loop. In the example below, the first ‘ParentVariable’ will render correctly, but the one within the “each” loop won’t. {{ParentVariable}} {{#each Users}} {{ParentVariable}} {{/each}} To use the variable within the “each” block, you’ll need to add a […]
Read MoreChrome displays a different height than what Chrome says the height should be.
This took me quite a while to track down, which is unfortunate since I know I’ve ran into this several times. Basically I was changing the height of an element, but no matter where I specified the height, it wasn’t displaying what I was putting in — even if I stuck a style attribute right […]
Read MoreGoogle Analytics Sucks
Yeah, it’s a little blunt and harsh, but over the years I’ve been growing more and more disatisfied with the tool. A long while ago, I created my own little website visitor tracking tool, which I have slowly been dusting off. Eventually I may completely remove Google from my websites and opt for my own […]
Read MoreRemoving the Horizontal Margins on a Google Chart Graph
I seem to be able to successfully modify quite a bit with google charts, but I couldn’t find a good way to remove the horizontal padding to the left and right of a google graph. From what I can find, there really isn’t a good way to do it. I thought I was close with […]
Read MorePHP JSON Returned As Object Instead of Array
I was returning, what I thought was an array from PHP, but it kept returning it as a json object, so I had something like: $listItem[0][0] = “Jan 1”; $listItem[0][1] = 100; $listItem[1][0] = “Jan 2”; $listItem[1][1] = 120; $listItem[2][0] = “Jan 2”; $listItem[2][1] = 120; …etc… This would return in javascript those an array, […]
Read More