This file contains hidden or 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> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<title>CSS Testing</title> | |
</head> | |
<body id="top"> | |
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> |
This file contains hidden or 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
# encoding: utf-8 | |
# @author Filipe Rocha <[email protected]> | |
# Describe Portugal's Administrative Areas | |
class DistritoConcelho | |
# @return [Array] list of [concelho, [distritos]] | |
def self.list | |
[ | |
['Aveiro', ['Águeda', 'Albergaria-a-Velha', 'Anadia', 'Arouca', 'Aveiro', 'Castelo de Paiva', 'Espinho', 'Estarreja', 'Santa Maria da Feira', 'Ílhavo', 'Mealhada', 'Murtosa', 'Oliveira de Azeméis', 'Oliveira do Bairro', 'Ovar', 'São João da Madeira', 'Sever do Vouga', 'Vagos', 'Vale de Cambra']], | |
['Beja', ['Aljustrel', 'Almodôvar', 'Alvito', 'Barrancos', 'Beja', 'Castro Verde', 'Cuba', 'Ferreira do Alentejo', 'Mértola', 'Moura', 'Odemira', 'Ourique', 'Serpa', 'Vidigueira']], |
This file contains hidden or 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
const the_animation = document.querySelectorAll('.animation') | |
const observer = new IntersectionObserver((entries) => { | |
entries.forEach((entry) => { | |
if (entry.isIntersecting) { | |
entry.target.classList.add('scroll-animation') | |
} else { | |
entry.target.classList.remove('scroll-animation') | |
} |
This file contains hidden or 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
p, | |
ul, | |
ol, | |
blockquote, | |
div { | |
margin-top: 0; | |
margin-bottom: 20px; | |
} | |
ul ul, |
This file contains hidden or 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
<? | |
/** | |
* Example of Changing All Rewrite Rules | |
* https://wordpress.stackexchange.com/questions/263624/add-rewrite-rules-prefix-everything | |
* | |
* @param array $rewrite_rules The compiled array of rewrite rules. | |
* @return array The compiled array of rewrite rules (altered). | |
*/ | |
function wpse_263624_rewrite_rules_example( $rewrite_rules ) { |
This file contains hidden or 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 | |
/*************************************************************/ | |
/* custom color swatches in Wysiwyg */ | |
/***********************************************************/ | |
function my_mce4_options($init) { | |
$custom_colors = ' | |
"36454f", "Gray", |
This file contains hidden or 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 echo date_i18n("d M Y", strtotime(get_field('inicio'))); ?> |
This file contains hidden or 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 | |
// This code is based in Mathew Horne blog post: https://matthewhorne.me/defer-async-wordpress-scripts/ | |
//function to add async attribute | |
function add_async_attribute($tag, $handle) { | |
$scripts_to_async = array('my-js-handle-async', 'another-handle-async'); | |
//check if this script is in the array | |
if (in_array($handle, $scripts_to_async)){ | |
//return with async | |
return str_replace(' src', ' async="async" src', $tag); |
This file contains hidden or 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
<? | |
add_filter('add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment'); | |
function woocommerce_header_add_to_cart_fragment( $fragments ) { | |
global $woocommerce; | |
ob_start(); | |
?> |
NewerOlder