Skip to content

Instantly share code, notes, and snippets.

View kristjankoppel's full-sized avatar

Kristjan Koppel kristjankoppel

View GitHub Profile
<p class="body--lead">This is some test lead text.</p>
<hr />
<p>OK, so images can get quite complicated as we have a few variables to work with! For example the image below has had a caption entered in the WordPress image upload dialog box, this creates a [caption] shortcode which then in turn wraps the whole thing in a <code>div</code> with inline styling! Maybe one day they'll be able to use the <code>figure</code> and <code>figcaption</code> elements for all this. Additionally, images can be wrapped in links which, if you're using anything other than <code>color</code> or <code>text-decoration</code> to style your links can be problematic.</p>
<div id="attachment_28" class="wp-caption alignnone" style="width: 510px"><a href="#"><img src="http://www.wpfill.me.s3-website-us-east-1.amazonaws.com/img/img_large.png" alt="Your Alt Tag" title="bmxisbest" width="500" height="300" class="size-large wp-image-28"></a><p class="wp-caption-text">This is the optional caption.</p></div>
<p>The next issue we face is imag
@kristjankoppel
kristjankoppel / woocommerce-custom-product-tab-and-meta-field-content.php
Created January 4, 2021 18:46 — forked from ben-heath/woocommerce-custom-product-tab-and-meta-field-content.php
Create WooCommerce Product Tab with content from Product Meta custom field
<?php
// add this code to the functions.php file of your Theme or Child Theme
/*
* Add Custom tabs to WooCommerce products which contain content stored in custom fields (product postmeta fields)
* This example is adding 3 tabs. Product Instructions, Size Chart, and Tech Specs
* There are 2 pieces that are needed:
* 1. Declare the tab
* 2. Declare the contents of the tab
* Recommended to use ACF (advanced custom fields plugin) to managage the tab content per product.
@kristjankoppel
kristjankoppel / README.md
Created August 10, 2017 19:41 — forked from astockwell/README.md
PHP Video Url Parser

Youtube/Vimeo Video Url Parser

Parses URLs from major cloud video providers. Capable of extracting keys from various video embed and link urls to manipulate and access videos in various ways.

Usage

VideoUrlParser::identify_service("https://www.youtube.com/watch?v=x_8kFbZf20I&amp;feature=youtu.be");