Instantly share code, notes, and snippets.

View filter-external.js
$('.filterBlog a').on('click', function(e) {
filterBlogHash(this.hash, e);
});
$(window).on('load',function() {
filterBlogHash(window.location.hash);
});
function filterBlogHash(hash, e) {
if(hash === '') {
View filter.js
$('.filterBlog').on('click', 'a', function(e){
e.preventDefault();
var hash = $(this).attr('href').replace(/^.*?(#|$)/,'');
$('.filter a.type').each(function (index, value) {
// console.log('filter' + index + ':' + $(this).attr('id'));
View functions.php
<?php
/**
* Related Posts.
*
* Usage:
* To show related by categories:
* Add in single.php <?php chr_related_posts(); ?>
* To show related by tags:
* Add in single.php <?php chr_related_posts( 'tag' ); ?>
*
View 00-README.md
View 00-README.md
View update_row_colours.js
jQuery(document).ready(function($) {
var update_row_colours = function() {
$('[data-name="adicionar_experiencias"] .acf-table .acf-row').each( function() {
var strat = $( this ).find('[data-name="iniciou_no_dia"] input.input-alt');
var end = $( this ).find('[data-name="terminou_no_dia"] input.input-alt');
var strat_date = new Date( strat.val() );
View README.md
View README.md

Formulário de Departamentos com Suporte de Option Group

Contact Form 7 + Option Group

Criação de um formulário via Contact Form 7 com select personalizado com Option Group para seleção de departamentos.

Download do Contact Form 7

View functions.php
<?php
/**
* Returns ID of top-level parent category, or current category if you are viewing a top-level
*
* @param string $catid Category ID to be checked
* @return string $catParent ID of top-level parent category
*/
function smart_category_top_parent_id ($catid) {
while ($catid) {
$cat = get_category($catid); // get the object for the catid