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 | |
$id = 'testimonial-' . $block['id']; | |
?> | |
<blockquote class="testimonial" id="<?php echo $id; ?>"> | |
<p><?php echo $data['testimonial']; ?></p> | |
<cite> | |
<img src="<?php echo $data['avatar']['url']; ?>" alt="<?php echo $data['avatar']['alt']; ?>"> | |
<span><?php echo $data['author']; ?></span> | |
</cite> | |
</blockquote> |
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 | |
$testimonial = get_field('testimonial'); | |
$author = get_field('author'); | |
$avatar = get_field('avatar'); | |
$id = 'testimonial-' . $block['id']; | |
?> | |
<blockquote class="testimonial" id="<?php echo $id; ?>"> | |
<p><?php echo $testimonial; ?></p> | |
<cite> |
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 editor_register_blocks() { | |
if ( function_exists('acf_register_block') ) { | |
acf_register_block(array( | |
'name' => 'testimonial', | |
'title' => __('Testimonial'), | |
'description' => __('A custom testimonial block.'), | |
'render_template' => 'blocks/testimonial.php', | |
'category' => 'formatting', |
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 editor_disable_core_blocks() { | |
$blacklist = array( | |
// -- Common | |
'core/paragraph', | |
'core/image', | |
'core/heading', | |
'core/subhead', | |
'core/gallery', |
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 getFirstPP($html) { | |
$start = strpos($html, '<p'); | |
$end = strpos($html, '</p>', $start); | |
$html = substr($html, $start, ($end - $start + 4)); | |
return $html; | |
} | |
function splitFirstPP($html) { | |
$parts = explode("</p>", $html, 2); | |
$first = $parts[0] . "</p>"; |
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
/* Pre-Define HTML5 Elements in IE */ | |
(function(){ var els = "source|address|article|aside|audio|canvas|command|datalist|details|dialog|figure|figcaption|footer|header|hgroup|keygen|mark|meter|menu|nav|picture|progress|ruby|section|time|video".split('|'); for(var i = 0; i < els.length; i++) { document.createElement(els[i]); } } )(); |
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
// Modernizr style test | |
if (!(window.webkitMatchMedia || window.mozMatchMedia || window.oMatchMedia || window.msMatchMedia || window.matchMedia)) { | |
var root = document.getElementsByTagName( 'html' )[0]; | |
root.className += ' no-matchmedia'; | |
} | |
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license - IE8 VERSION! */ | |
window.matchMedia = window.matchMedia || (function(doc, undefined){ | |
var docElem = doc.documentElement, |
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
// Modernizr style test | |
if (!(window.webkitMatchMedia || window.mozMatchMedia || window.oMatchMedia || window.msMatchMedia || window.matchMedia)) { | |
var root = document.getElementsByTagName( 'html' )[0]; | |
root.className += ' no-matchmedia'; | |
} | |
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */ | |
window.matchMedia || (window.matchMedia = function() { | |
"use strict"; |
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
ol { counter-reset: item; } | |
ol li, ul li { color: black; list-style: none; } | |
ol li:before { color: red; counter-increment: item; content: counter(item) ". "; margin: 0 0 0 -20px; text-align: right; } | |
ul li:before { background: transparent; border: 1px solid red; border-radius: 100%; content: ''; display: block; float: left; height: 8px; margin: 10px 0 0 -20px; width: 8px; } |
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 splitFirstP($html) { | |
$parts = explode("</p>", $html, 2); | |
$parts[0] = $parts[0]."</p>"; | |
return $parts; | |
} | |
function splitCenterContent($html) { | |
$return = array(); | |
$parts = explode("</p>", $html); | |
$middle = floor(count($parts) / 2) - 1; |
NewerOlder