This file contains hidden or 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 | |
add_action( 'after_setup_theme', 'meu_blog_traducao_init' ); | |
function meu_blog_traducao_init() { | |
load_theme_textdomain( 'nome-do-tema', TEMPLATEPATH . '/languages' ); | |
} | |
/* | |
* Strings que irão receber tradução deve estar como: | |
* <?php _e('Palavra que vai ser traduzida', 'nome-do-tema'); ?> |
This file contains hidden or 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 | |
// Add metabox | |
function dfw_slideshow_metabox() { | |
add_meta_box( | |
'dfw-metabox', | |
'Slideshow', | |
'dfw_slideshow_metabox_content', | |
'post', | |
'side' |
This file contains hidden or 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 meu_wp_login_url() { | |
return get_bloginfo('url'); | |
} | |
add_filter('login_headerurl', 'meu_wp_login_url'); | |
function meu_wp_login_title() { | |
return get_bloginfo('name'); | |
} | |
add_filter('login_headertitle', 'meu_wp_login_title'); |
This file contains hidden or 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
// Errado: | |
$(document).ready(function() { | |
// código usando $ | |
} | |
// Certo: | |
jQuery(document).ready(function($) { | |
// código usando $ | |
} |
This file contains hidden or 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 | |
// Inicia uma contagem. | |
$n = 0; | |
// Cria o loop. | |
if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> | |
<?php if ($n < 2) : ?> | |
<!-- Seu código para aparecerem as imagens menores --> |
This file contains hidden or 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 get_header(); ?> | |
<div id="primary"> | |
<section id="content" role="main"> | |
<?php if ( have_posts() ) : ?> | |
<?php while ( have_posts() ) : the_post(); ?> | |
<article <?php post_class(); ?>> | |
<img src="<?php echo get_option( 'url' );?>/<?php echo get_post_meta( $post->ID, 'post-thumbnails' ,true );?>" | |
title="<?php the_title();?>" alt="<?php the_title();?>" | |
width="300px" height="255px"> | |
<a href="<?php the_permalink()?>" title="<?php the_title();?>" alt="<?php the_title();?>"><?php the_title();?></a> |
This file contains hidden or 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 | |
/** | |
* Custom posts per page for Taxonomy | |
*/ | |
function cs_custom_posts_per_page( $query ) { | |
if ( is_tax( 'Categorias' ) ) { | |
$query->query_vars['posts_per_page'] = 1; | |
return; |
This file contains hidden or 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 | |
query_posts('cat=-24&posts_per_page=10'); | |
// resto do código... |
This file contains hidden or 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
<!DOCTYPE html> | |
<!--[if IE 6]><html id="ie6" dir="ltr" lang="pt-BR"><![endif]--> | |
<!--[if IE 7]><html id="ie7" dir="ltr" lang="pt-BR"><![endif]--> | |
<!--[if IE 8]><html id="ie8" dir="ltr" lang="pt-BR"><![endif]--> | |
<!--[if !(IE 6) | !(IE 7) | !(IE 8)]><!--><html dir="ltr" lang="pt-BR"><!--<![endif]--> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Menu</title> | |
<style> |
This file contains hidden or 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 | |
/** | |
* Force Excerpt in Feeds | |
* | |
* @param string $content Content of post | |
* | |
* @return string Excerpt of post | |
*/ | |
function cs_feed_force_excerpt( $content ) { |