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
<?php | |
// Meses | |
$mes = array( '', 'Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro' ); | |
$years = $wpdb->get_col( "SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY post_date DESC" ); | |
foreach( $years as $year ) { | |
$months = $wpdb->get_col( "SELECT DISTINCT MONTH(post_date) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' AND YEAR(post_date) = '" . $year . "' ORDER BY post_date DESC" ); | |
foreach( $months as $key => $month ) { |
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
<?php | |
$result = count_users(); | |
$subscribers; | |
$admin; | |
foreach($result['avail_roles'] as $role => $count) { | |
if( $role == 'administrator' ) | |
$admin = $count; | |
if( $role == 'subscriber' ) | |
$subscribers = $count; |
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 is_email( email ) { | |
var exclude = /[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/; | |
var check = /@[\w\-]+\./; | |
var checkend = /\.[a-zA-Z]{2,3}$/; | |
if( ( ( email.search( exclude ) != -1 )||( email.search( check ) ) == -1 )||( email.search( checkend ) == -1 ) ) { return false } | |
else { return true } | |
} |
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
RewriteEngine On | |
# URLs Amigaveis | |
RewriteRule ^(sobre|produtos|contato)/?$ ?p=$1 | |
# Erro 404 | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{SCRIPT_FILENAME} !\.(jpg|png|gif) | |
RewriteRule ^(.*)$ ?p=404 [L] |
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
<?php | |
/*-------------------------------------------------------------------------------------- | |
* | |
* @name: my_home_url | |
* @description: Modificar home_url para Windows | |
* @author: Volts Digital | |
* | |
*-------------------------------------------------------------------------------------*/ | |
function my_home_url( $url ) { | |
$other_url = explode( '://', $url ); // quebra em http e restante do site |
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
var app = angular.module('myApp', []); | |
app.config(['$locationProvider', '$routeProvider', function( $locationProvider, $routeProvider ) { | |
$locationProvider.html5Mode( true ); | |
$routeProvider | |
.when('/', { controller : 'controller', templateUrl : 'views/home.html' }) | |
.when('/empresa', { controller : 'controller', templateUrl : 'views/register-company.html' }) | |
.when('/profissional', { controller : 'controller', templateUrl : 'views/register-professional.html' }) | |
.otherwise({ redirectTo : 'views/404.html' }); |
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
<?php | |
/* | |
Use para chamar qualquer arquivo dentro do tema. | |
Ex: echo theme_url( 'assets/images/logo.png' ); | |
*/ | |
function theme_url( $path = null ) { | |
return get_template_directory_uri() . '/' . $path; | |
} |
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
<?php | |
function enqueue_scripts() { | |
wp_enqueue_script( 'jquery-ui-core' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'enqueue_scripts' ); |
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
jQuery(function($) { | |
var $map = $( '#map-canvas' ), | |
address = $map.data( 'address' ), | |
lat, lng, | |
map_options = {}, | |
map, marker; | |
$.ajax({ | |
url : 'http://maps.googleapis.com/maps/api/geocode/json', | |
dataType : 'json', |
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() { | |
// Somente números | |
$( 'input.numero' ).on( 'keydown', function(e) { | |
var keyCode = e.keyCode || e.which, | |
pattern = /\d/, | |
// Permite somente Backspace, Delete e as setas direita e esquerda, números do teclado numérico - 96 a 105 - (além dos números) | |
keys = [ 46, 8, 9, 37, 39, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105 ]; | |
if( ! pattern.test( String.fromCharCode( keyCode ) ) && $.inArray( keyCode, keys ) === -1 ) { |