Skip to content

Instantly share code, notes, and snippets.

View sergiopvilar's full-sized avatar

Sergio Vilar sergiopvilar

View GitHub Profile
<?php
function plano_reg(){
$taxonomy = array (
'hierarchical' => '1',
'public' => '',
'label' => '',
'singular_label' => '',
'name' => '',
'show_ui' => '1',
HTTP/1.1 200 OK
Date: Thu, 03 May 2012 00:58:15 GMT
Server: Apache/2.0.64 (Unix) mod_ssl/2.0.64 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_perl/2.0.5 Perl/v5.8.8
X-Powered-By: PHP/5.2.9
X-Pingback: http://tvfiscal-pb.com.br/xmlrpc.php
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
HTTP/1.1 301 Moved Permanently
Date: Thu, 03 May 2012 00:57:41 GMT
Server: Apache/2.2.15 (CentOS) DAV/2 PHP/5.3.3
X-Powered-By: W3 Total Cache/0.9.2.4
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
X-Pingback: http://www.joaopessoa.pb.gov.br/portal/xmlrpc.php
Location: http://www.joaopessoa.pb.gov.br/?theme=pmjp_mobile
Vary: User-Agent
@sergiopvilar
sergiopvilar / wp-theme.sublime-snippet
Created June 5, 2012 19:02
Snippet do Subime Text para criação de Temas Wordpress
<snippet>
<content><![CDATA[
/*
Theme Name: ${1:SELECTION}
Theme URI: http://${2:site}.com.br
Author: ${3:agencia} - Sérgio Vilar
Author URI: http://about.me/vilar
Description: Tema desenvolvido para o site ${1:SELECTION}
Version: 1.0
*/
@sergiopvilar
sergiopvilar / wp-post-type.sublime-snippet
Created June 5, 2012 19:04
Snippet para criação de Post Types com o Turumim Framework
<snippet>
<content><![CDATA[
\$labels = array(
'name' => _x('${1:SELECTION}s', 'post type general name'),
'singular_name' => _x('${1:SELECTION}', 'post type singular name'),
'add_new' => _x('Cadastrar novo', 'edital item'),
'add_new_item' => __('Cadastrar novo'),
'edit_item' => __('Editar'),
'new_item' => __('Cadastrar novo'),
'view_item' => __('Visualizar'),
<?php
// Todo código aqui será executado apenas quando o tema for ativado
// ==== Cria páginas: Alexandre Rossi
if(!page_exists('alexandre-rossi'))
$alexandre_id = add_page('Alexandre Rossi', 'alexandre-rossi');
if(!page_exists('projetos-especiais'))
add_page('Projetos Especiais', 'projetos-especiais', null, $alexandre_id);
function strpos (haystack, needle, offset) {
var i = (haystack + '').indexOf(needle, (offset || 0));
return i === -1 ? false : i;
}
function MobileRedirect(url){
if ((screen.width <= 480) || (screen.height <= 480)) {
if(strpos(url,'?',1)){
location.href = url+'&theme=pmjp_mobile';
<?php
/**
* @package WordPress
* @subpackage PMJP 2011.3 - 10/nov/2011
* @author Hagg Agência Interativa | http://www.hagg.com.br | contato AT hagg.com.br
* search.php
*/
get_header();
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
<?php
function getPostViews($postID){
$count_key = 'post_views_count';
$count = get_post_meta($postID, $count_key, true);
if($count==''){
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, '0');
return "0 View";
}
<?php
$app_id = APP_ID;
$app_secret = APP_SECRET;
$my_url = REDIRECT_URI;
//if(isset($_REQUEST["code"])) $code = $_REQUEST["code"];*/
$facebook = new Facebook(array(
'appId' => APP_ID,
'secret' => APP_SECRET
));