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 foo(){ | |
//cpt $labels, $rewrite, $args | |
. | |
. | |
. | |
register_post_type('cpt',$args); | |
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('WP_DEBUG', false); | |
@ini_set('log_errors', 1); | |
@ini_set('display_errors', 0); /* enable or disable public display of errors (use 'On' or 'Off') */ | |
@ini_set('error_log', dirname(__FILE__) . '/wp-content/logs/php-errors.log'); /* path to server-writable log file */ | |
@ini_set( 'error_reporting', E_ALL ^ E_NOTICE ); /* the php parser to all errors, excreportept notices. */ | |
?> |
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
http://askubuntu.com/questions/118772/how-to-change-root-password-for-mysql-and-phpmyadmin | |
bonus: https://www.digitalocean.com/community/articles/how-to-install-and-secure-phpmyadmin-on-debian-7 |
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 | |
/* limit number of post revisions */ | |
//http://perishablepress.com/stupid-wordpress-tricks/ | |
define('WP_POST_REVISIONS', 3); | |
?> |
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 | |
$menu_name = 'main_nav'; | |
$locations = get_nav_menu_locations(); | |
$menu = wp_get_nav_menu_object( $locations[ $menu_name ] ); | |
$menuitems = wp_get_nav_menu_items( $menu->term_id, array( 'order' => 'DESC' ) ); | |
?> | |
<nav> | |
<ul class="main-nav"> | |
<?php |
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 | |
$the_tax = get_taxonomy( get_query_var( 'taxonomy' ) ); | |
echo $the_tax->labels->name; | |
?> |
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 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', | |
); |
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 | |
//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 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 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 |