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 | |
$pages = array( 'sobre', 'contato' ); | |
// Verificar se a URL acessada consta no array. | |
if( in_array( get_query_var( 'pagename' ), $pages ) ) { | |
header( 'HTTP/1.1 200 OK' ); | |
get_template_part( 'page-' . get_query_var( 'pagename' ) ); | |
die(); | |
} else { |
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
Show hidden characters
{ | |
"curly": true, | |
"eqeqeq": true, | |
"immed": true, | |
"latedef": true, | |
"newcap": true, | |
"noarg": true, | |
"sub": true, | |
"undef": true, | |
"boss": 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
/** | |
* @param username - (required) O nome de usuário ou da página que você quer que retorne os dados | |
* @param data - (return) Retorno da função com os dados do usuário ou página do Facebook | |
* | |
*/ | |
$.ajax({ | |
url : 'http://graph.facebook.com/'+ username +'?callback=?', | |
dataType : 'jsonp', | |
success : function( data ) { |
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 custom_search_where($where) { | |
// put the custom fields into an array | |
$customs = array('custom_field1', 'custom_field2', 'custom_field3'); | |
foreach($customs as $custom) { | |
$query .= " OR ("; | |
$query .= "(m.meta_key = '$custom')"; | |
$query .= " AND (m.meta_value LIKE '{$n}{$term}{$n}')"; | |
$query .= ")"; |
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 $konami = $('#konami'), | |
$all = $('#all'), | |
$msg = $('#msg'), | |
keyCode, | |
konami_code = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65], | |
konami_code_count = konami_code.length - 1, | |
cont = 0; | |
$(document).on('keydown', function(e) { | |
keyCode = e.keyCode || e.which; |
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
<section> | |
<h1>Posts do blog</h1> | |
<article> | |
<h1>Título do artigo</h1> | |
<p>Resumo do artigo</p> | |
</article> | |
<article> | |
<h1>Título do artigo</h1> |
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( window, document, $ ) { | |
var obj = function() { | |
}; | |
})( window, document, jQuery ); |
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 | |
define('MPDF_PATH', 'class/mpdf/'); | |
include(MPDF_PATH.'mpdf.php'); | |
$mpdf=new mPDF(); | |
$mpdf->WriteHTML('Hello World'); | |
$mpdf->Output(); | |
exit(); |
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 | |
/** | |
* @param $query - (required) Query utilizada para o loop. Se for uma query personalizada, passe o objeto. Senão, passe $wp_query | |
* @param $baseURL - (optional) URL a partir de onde a paginação deve ser feita. | |
* | |
*/ | |
function pagination( $query, $baseURL = '' ) { | |
if ( ! $baseURL ) $baseURL = get_bloginfo( 'url' ); | |
$page = $query->query_vars["paged"]; | |
if ( !$page ) $page = 1; |
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 | |
/** | |
* Arquivo para criação de CPTs e Taxonomias | |
* | |
*/ | |
// CPT Labs | |
$create_cpt->cpt( array( | |
'slug' => 'labs', | |
'name' => 'Labs', |