Skip to content

Instantly share code, notes, and snippets.

View eliasfaical's full-sized avatar
🏠
Working from home

Elias Faiçal eliasfaical

🏠
Working from home
View GitHub Profile
@eliasfaical
eliasfaical / get-taxonomy
Created July 16, 2013 12:30
Pegar a Taxonomia atual
<?php
#Taxonomia
$terms = get_the_terms( $post->ID , 'servico');
if($terms) {
foreach( $terms as $term ) {
$nome_tax = $term->name;
$slug_tax = $term->slug;
}
}
@eliasfaical
eliasfaical / function.php
Created July 16, 2013 19:58
Arquivo Function
<?php
# Path to require 'posttype.php'
$functions_path = get_template_directory() . '/functions/';
# Require
require_once( $functions_path . 'posttype.php' );
# Pega o slug da pagina atual
@eliasfaical
eliasfaical / active-menu.js
Created July 26, 2013 13:18
Deixar o menu ativo
// Active menu
//---- versão 1 ----//
var url = window.location.pathname,
urlRegExp = new RegExp(url == '/' ? window.location.origin + '/?$' : url.replace(/\/$/,''));
$('nav a').each(function(){
if(urlRegExp.test(this.href.replace(/\/$/,''))){
$(this).addClass('active');
}
.border-radius( @radius: 3px ) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
border-radius: @radius;
}
.outline-radius( @radius: 3px ) {
-webkit-outline-radius: @radius;
-moz-outline-radius: @radius;
outline-radius: @radius;
@eliasfaical
eliasfaical / mascara-telefone.js
Created August 19, 2013 12:37
// Cria a máscara para o campo de telefone
function mascara(o,f){
v_obj = o
v_fun = f
setTimeout("execmascara()",1)
}
function execmascara(){
v_obj.value = v_fun(v_obj.value)
}
@eliasfaical
eliasfaical / gradient.css
Created August 28, 2013 13:29
CSS Gradient
a {
color: #FFF;
display: block;
height: 25px;
padding: 6px 20px 4px 20px;
background: #1a3376;
background-image: -webkit-linear-gradient(to bottom, #2e5293, #1a3376 130%);
background-image: -moz-linear-gradient(to bottom, #2e5293, #1a3376 130%);
background-image: -ms-linear-gradient(to bottom, #2e5293, #1a3376 130%);
background-image: -o-linear-gradient(to bottom, #2e5293, #1a3376 130%);
<?php
$args = array(
'post_type' => 'noticia'
);
$query = new WP_Query( $args );
if( $query->have_posts() ) : $i = 1;
while( $query->have_posts() ) : $query->the_post();
@eliasfaical
eliasfaical / ajax-load.js
Last active August 29, 2015 13:56
Carregando conteúdo com ajax no wordpress
window.onload = function() {
$.ajaxSetup({ cache: false });
$(".galery").on('click', function(event) {
event.preventDefault();
var post_id = $(this).attr("rel");
$("#lightbox").fadeIn("fast");
// class dos links que vão receber o click
$(".link-menu").on("click", function(event){
// a animação vai ocorrer no html, body
$('html, body').animate({
// pega o atributo href do this (link que recebeu o click)
// e faz a animação com velocidade 1000 para o destino do href;
scrollTop: $($(this).attr("href")).offset().top
@eliasfaical
eliasfaical / preferencia.sublime
Created February 12, 2014 18:44
Preferences.sublime-settings
{
"bold_folder_labels" : true,
"caret_style" : "phase",
"color_scheme" : "Packages/Theme - Spacegray/base16-ocean.dark.tmTheme",
"fade_fold_buttons" : false,
"find_selected_text" : true,
"font_size" : 13,
"highlight_line" : true,
"highlight_modified_tabs": true,
"ignored_packages":