This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php function slugify($text) | |
{ | |
// replace non letter or digits by - | |
$text = preg_replace('~[^\\pL\d]+~u', '-', $text); | |
// trim | |
$text = trim($text, '-'); | |
// transliterate | |
$text = iconv('utf-8', 'us-ascii//TRANSLIT', $text); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html> | |
<head> | |
<title></title> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<style type="text/css"> | |
@import url(https://fonts.googleapis.com/css?family=Roboto:400,400italic,700,700italic); | |
body { | |
margin: 0; | |
padding: 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php function my_acf_relationship_result( $html, $post ) | |
{ | |
// add an image to each result | |
$field = get_field('varenummer', $post->ID); | |
if( $field ) | |
{ | |
$html = '<strong>' . $field . '</strong> - ' . $html; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$json_url = "http://api.randomuser.me/?format=json&results=10"; | |
$json = file_get_contents($json_url); | |
$links = json_decode($json, TRUE); | |
foreach($links['results'] as $key=>$val ){ | |
$user_image_large = $val['user']['picture']['large']; | |
$user_image_medium = $val['user']['picture']['medium']; | |
$user_image_thumbnail = $val['user']['picture']['thumbnail']; | |
$user_firstname = ucfirst($val['user']['name']['first']); | |
$user_lastname = ucfirst($val['user']['name']['last']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$('iframe[src*="youtube"]').wrap( "<div class='thing-with-video'></div>" ); | |
$('iframe[src*="vimeo"]').wrap( "<div class='thing-with-video'></div>" ); | |
// Target your .container, .wrapper, .post, etc. | |
$(".thing-with-video").fitVids(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Removes tabs from their original loaction | |
remove_action( 'HOOK NAME', 'FUNCTION NAME', 10 ); | |
// Inserts tabs under the main right product content | |
add_action( 'HOOK NAME', 'FUNCTION NAME', 60 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mytheme_feature_widget_template( $filename, $instance, $widget ){ | |
$filename = get_stylesheet_directory() . '/partials/feature-widget-template.php'; | |
return $filename; | |
} | |
add_filter( 'siteorigin_widgets_template_file_secondthought-feature-widget', 'mytheme_feature_widget_template', 10, 3 ); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// libsass (v3.5.0.beta.2) | |
// ---- | |
.inzite-menu-widget.simple.hierarchy { | |
a { | |
text-decoration: none; | |
} | |
ul { | |
list-style: none; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function($) { | |
$.fn.vantageSmoothScroll = function () { | |
$( this ).click( function ( e ) { | |
var $a = $( this ); | |
var $target = $( '[name=' + this.hash.slice( 1 ) + ']' ).length ? $( '[name=' + this.hash.slice( 1 ) + ']' ) : $( $a.get( 0 ).hash ); | |
if ( $target.length ) { | |
var height = 0; | |
if ( $( '#masthead .site-navigation' ).hasClass( 'use-sticky-menu' ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- html:5>(header.site-header>span.__logo{logo}+nav.__navigation>ul.__navigation-list>li.__navigation-item*3>a.__navigation-link[href="#"]{Menuitem})|bem|c --> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> |