This workshop encourages students to make use of npm modules to build complex and interesting artworks.
If you find a module you want to use, like riso-colors, you can install it from your project folder like so:
npm install riso-colors
function defer_parsing_of_js($url) | |
{ | |
if (is_admin()) return $url; //don't break WP Admin | |
if (false === strpos($url, '.js')) return $url; | |
if (strpos($url, 'jquery.js')) return $url; | |
return str_replace(' src', ' defer src', $url); | |
} | |
add_filter('script_loader_tag', 'defer_parsing_of_js', 10); |
This workshop encourages students to make use of npm modules to build complex and interesting artworks.
If you find a module you want to use, like riso-colors, you can install it from your project folder like so:
npm install riso-colors
// For more infos, see: https://github.com/jquense/yup/blob/master/src/locale.js | |
import { setLocale } from 'yup' | |
const translation = { | |
mixed: { | |
default: '${path} é inválido', | |
required: '${path} é um campo obrigatório', | |
oneOf: '${path} deve ser um dos seguintes valores: ${values}', | |
notOneOf: '${path} não pode ser um dos seguintes valores: ${values}', | |
}, |
<?php if(get_field('slides')): $i = 0; while(has_sub_field('slides')): $i++; if ($i != 1): ?> | |
<!-- Do Stuff Here --> | |
<?php endif; endwhile; endif; ?> | |
<!-- http://support.advancedcustomfields.com/forums/topic/repeater-skip-first-row/ --> |
<?php | |
// parameters | |
$hubVerifyToken = 'TOKEN123456abcd'; | |
$accessToken = "xxx"; | |
// check token at setup | |
if ($_REQUEST['hub_verify_token'] === $hubVerifyToken) { | |
echo $_REQUEST['hub_challenge']; | |
exit; | |
} |
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php | |
*/ | |
$args = array( |
<?php if ( get_field( 'slides' ) ) : // repeater field ?> | |
<ul class="slider"> | |
<?php while ( the_repeater_field( 'slides' ) ) : | |
$image = get_sub_field( 'slide' ); // sub-field image ID | |
$slide = wp_get_attachment_image_src( $image, 'slides' ); | |
$alt = get_post_meta( $image, '_wp_attachment_image_alt', true ); | |
?> | |
<li><img src="<?php echo $slide[0]; ?>" alt="<?php echo $alt; ?>"></li> | |
<?php endwhile; ?> |
<?php | |
// WP_Query arguments | |
$args = array ( | |
'post_type' => 'tipodopost', | |
'category_name' => 'slugdacategoria', | |
'posts_per_page' => '-1', | |
); | |
// The Query | |
$query = new WP_Query( $args ); |