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 | |
// Setup Image data | |
$id = get_field('topbillede'); | |
$size = 'full'; // (thumbnail, medium, large, full or custom size) | |
$image_attributes = wp_get_attachment_image_src( $id, $size ); | |
?> | |
<img src="<?php echo $image_attributes[0]; ?>" width="<?php echo $image_attributes[1]; ?>" height="<?php echo $image_attributes[2]; ?>"> |
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 | |
/* | |
Template Name: Isotope Test | |
*/ | |
?> | |
<?php get_header();?> | |
<div class="container"> | |
<div class="row"> |
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
// Use live database on local installation | |
<?php | |
// paste this in a (new) file, wp-content/db.php | |
add_filter ( 'pre_option_home', 'test_localhosts' ); | |
add_filter ( 'pre_option_siteurl', 'test_localhosts' ); |
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 | |
/* | |
Template Name: Isotope Test | |
*/ | |
?> | |
<?php get_header();?> | |
<div class="container"> | |
<div class="row"> |
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']); |
OlderNewer