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
//scroll FAQ | |
document.addEventListener('DOMContentLoaded', function () { | |
document.querySelector('.meta-about-content-left[data-section=faq]').addEventListener('click', function (e) { | |
e.preventDefault(); | |
//get id to jump | |
const itemlink = $(e.target); | |
if (itemlink.is("a")) { | |
let value = itemlink.attr('href'); | |
let jump; |
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
//uploads to specific dir | |
//allow xml and .wer | |
$allowedExtensions = array('wer' => 'application/wer', 'xml' => 'application/xml'); | |
$pathinsideuploads = '/myfiles'; | |
add_filter('upload_mimes', 'custom_upload_files'); | |
function custom_upload_files($mimes) { | |
global $allowedExtensions; | |
$mimes = array_merge($mimes, $allowedExtensions); | |
return $mimes; |
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 getRandomColor() { | |
let letters = '0123456789ABCDEF'; | |
let color = '#'; | |
for (let i = 0; i < 6; i++) { | |
color += letters[Math.floor(Math.random() * 16)]; | |
} | |
return color; | |
} |
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
//check select field from .json | |
add_filter('acf/load_field/key=field_5af2cece02f00', function( $field ){ | |
// options of the choices to add to select | |
$field['choices'] = array(); | |
// dynamic data we want to popuplate with | |
$bundles = get_field('gerir_marcas', 'option' ); | |
//$portfolio = get_field('item_portfolio','option'); | |
//var_dump($bundles); |
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
//WPML home page link | |
$my_home_url = apply_filters( 'wpml_home_url', get_option( 'home' ) ); | |
//WPML get current active language | |
if ( defined( 'ICL_LANGUAGE_CODE' ) ) { | |
$activeen = ''; | |
$activept = ''; | |
//get current page/post id | |
global $wp_query; | |
$imthispage = $wp_query->post->ID; | |
//get the perm link |
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
//https://codehandbook.org/how-to-remove-duplicates-from-javascript-array/ | |
//remover duplicados | |
function removeDuplicates(arr) { | |
let unique_array = [] | |
for (let i = 0; i < arr.length; i++) { | |
if (unique_array.indexOf(arr[i]) == -1) { | |
unique_array.push(arr[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
<!-- //original: https://codepen.io/gschier/pen/HCoqh --> | |
<!-- thumbnail image wrapped in a link --> | |
<a href="#img1"> | |
<img src="http://insomnia.rest/images/screens/main.png" class="thumbnail"> | |
</a> | |
<a href="#img2"> | |
<img src="http://via.placeholder.com/1350x1150" class="thumbnail"> | |
</a> |
OlderNewer