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 favicon to site, add 16x16 or 32x32 "favicon.ico" image to child themes main folder | |
function childtheme_add_favicon() { ?> | |
<link rel="shortcut icon" href="<?php echo get_stylesheet_directory_uri(); ?>/favicon.ico" /> | |
<?php } | |
add_action('wp_head', 'childtheme_add_favicon'); | |
?> |
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> | |
<html> | |
<body> | |
<div id="ytplayer"></div> | |
<script> | |
// Load the IFrame Player API code asynchronously. | |
var tag = document.createElement('script'); | |
tag.src = "https://www.youtube.com/player_api"; |
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 mostra(){ | |
//http://stackoverflow.com/a/15505132 - reference | |
global $post; | |
$taxonomies = get_object_taxonomies($post->post_type); | |
foreach ($taxonomies as $taxonomy) { | |
$terms = get_the_terms( $post->ID, $taxonomy ); | |
if ( !empty( $terms ) ) { | |
foreach ( $terms as $term ){ |
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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
*/ | |
$args = array( |
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 | |
/* 1. Back End Usage | |
---------------------------------------------------------------------*/ | |
// add neccessary actions | |
// @see http://codex.wordpress.org/Function_Reference/add_action | |
add_action( 'add_meta_boxes', 'rg_add_custom_box' ); | |
add_action( 'save_post', 'rg_save_postdata', 10, 1 ); |
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 | |
/* Register custom post types on the 'init' hook. */ | |
add_action( 'init', 'my_register_post_types' ); | |
/** | |
* Registers post types needed by the plugin. | |
* | |
* @since 0.1.0 | |
* @access public |
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
# CACHE | |
# 1 YEAR | |
<FilesMatch "\.(ico|pdf|flv)$"> | |
Header set Cache-Control "max-age=29030400, public" | |
</FilesMatch> | |
# 1 WEEK | |
<FilesMatch "\.(jpg|jpeg|png|gif|swf)$"> | |
Header set Cache-Control "max-age=604800, public" | |
</FilesMatch> | |
# 2 DAYS |
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 | |
//remove comments from jetpack carrousel | |
function filter_media_comment_status( $open, $post_id ) { | |
// http://aahank.com/2013/disable-comments-jetpack-carousel/ | |
$post = get_post( $post_id ); | |
if( $post->post_type == 'attachment' ) { | |
return false; | |
} | |
return $open; | |
} |
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 list_pages(){ | |
//http://codex.wordpress.org/Function_Reference/wp_list_pages | |
//lista as paginas criadas no wordpress | |
$args = array( | |
'title_li' => __( '' ), | |
'sort_column' => 'menu_order, post_title', | |
'exclude' => '2,5,6,7,8,9', | |
'post_type' => 'page', | |
); |