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 cs_display_custom_fields( $content ) { | |
// Recupera o objeto post. | |
global $post; | |
// Testa se é uma página simples e se o tipo do conteúdo é o seu. | |
if ( is_single() && $post->post_type == 'nome_do_seu_post_type_aqui' ) { | |
// Aqui como pegar as informações que foram salvas com o metabox: |
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 | |
// Tell me the root folder path. | |
// You can also try this one | |
// $HOME = $_SERVER["DOCUMENT_ROOT"]; | |
// Or this | |
// dirname(__FILE__) | |
$HOME = dirname( __FILE__ ); | |
// Is this a Windows host ? If it is, change this line to $WIN = 1; | |
$WIN = 0; |
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
$sprites: sprite-map("sprites/*.png"); | |
$sprites-retina: sprite-map("sprites-retina/*.png"); | |
@mixin sprite-background($name) { | |
background-image: sprite-url($sprites); | |
background-position: sprite-position($sprites, $name); | |
background-repeat: no-repeat; | |
display: block; | |
height: image-height(sprite-file($sprites, $name)); | |
width: image-width(sprite-file($sprites, $name)); |
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
<header> | |
<h1 id="post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1> | |
<div class="entry-info"><span class="info1"><?php the_time('d \d\e F \d\e Y'); ?> </span> <span class="info2"> Por: <?php echo '<a href="' . get_the_author_meta( 'user_url' ) . '" rel="me" title="' . get_the_author() . '">' . get_the_author() . '</a>'; ?></span> | |
<span class="cat1"><?php if ( count( get_the_category() ) ) : ?> | |
<?php printf( __( '<span class="%1$s">Arquivado em </span> %2$s'), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?> </span> <?php endif; ?></div> | |
</header> |
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 cs_custom_posts_per_page( $query ) { | |
$query->query_vars['posts_per_page'] = 9999; | |
return; | |
} | |
add_filter( 'pre_get_posts', 'cs_custom_posts_per_page' ); |
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
# Update post_content | |
UPDATE wp_posts SET post_content = REPLACE(post_content,'http://localhost/wp-content/uploads/','http://localhost/wordpress/wp-content/uploads/'); | |
# Update guid | |
UPDATE wp_posts SET guid = REPLACE(guid,'http://localhost/wp-content/uploads/','http://localhost/wordpress/wp-content/uploads/'); |
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 | |
/* | |
* Plugin Name: Personaliza Biografia | |
* Plugin URI: http://claudiosmweb.com/ | |
* Description: Personaliza Biografia. | |
* Version: 0.1 | |
* Author: Claudio Sanches | |
* Author URI: http://claudiosmweb.com/ | |
* License: GPLv2 or later | |
*/ |
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 | |
/** | |
* Excluir categorias da homepage. | |
* | |
* @param object $query Query padrão. | |
* | |
* @return object Query sem algumas categorias. | |
*/ | |
function cs_homepage_loop( $query ) { | |
// Funciona apenas na home. |
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 | |
/* | |
* Plugin Name: Category Image Field | |
* Plugin URI: http://claudiosmweb.com/ | |
* Description: Adds image field in category description. | |
* Version: 0.1 | |
* Author: Claudio Sanches | |
* Author URI: http://claudiosmweb.com/ | |
* License: GPLv2 or later | |
*/ |
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
# Update post_content | |
UPDATE wp_posts SET post_content = REPLACE(post_content,'http://www.url-antiga.com.br/','http://www.url-nova.com.br/'); | |
# Update guid | |
UPDATE wp_posts SET guid = REPLACE(guid,'http://www.url-antiga.com.br/','http://www.url-nova.com.br/'); |