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
<IfModule mod_deflate.c> | |
SetOutputFilter DEFLATE | |
<IfModule mod_setenvif.c> | |
# Netscape 4.x has some problems | |
BrowserMatch ^Mozilla/4 gzip-only-text/html | |
# Netscape 4.06-4.08 have some more problems | |
BrowserMatch ^Mozilla/4\.0[678] no-gzip |
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
// array starts with 0, so adding 1 will equal the count | |
<?php if( ($wp_query->current_post + 1) == ($wp_query->post_count)) : ?>foo<?php endif; ?> |
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
$ ssh hostname | |
$ mysql -u root | |
$ show databases; | |
// copy desired DB_NAME | |
$ exit // exit mysql console | |
$ exit // exit ssh connection |
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 | |
// Define custom query parameters | |
$custom_query_args = array( | |
'post_type' => 'news', | |
'orderby' => 'asc', | |
'paged' => $paged, | |
'posts_per_page' => 2 | |
); |
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
// In functions.php. Creates accessible array of bloginfo parameters | |
// http://codex.wordpress.org/Template_Tags/bloginfo | |
function bloginfo_shortcode( $atts ) { | |
extract(shortcode_atts(array( | |
'key' => '', | |
), $atts)); | |
return get_bloginfo($key); | |
} | |
add_shortcode('bloginfo', 'bloginfo_shortcode'); |
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 $page_id = get_page_by_title($page->page_title); | |
$page_data = get_page($page_id); ?> | |
<p><?php echo $page_data->post_content; ?></p> |
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
add_action("publish_post", "eg_create_sitemap"); | |
add_action("publish_page", "eg_create_sitemap"); | |
function eg_create_sitemap() { | |
$postsForSitemap = get_posts(array( | |
'numberposts' => -1, | |
'orderby' => 'modified', | |
'post_type' => array('post','page'), | |
'order' => 'DESC' | |
)); |
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
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
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
// in .htaccess | |
<FilesMatch "\.(mov|mp3|mp4|wav|pdf)$"> | |
ForceType application/octet-stream | |
Header set Content-Disposition attachment | |
</FilesMatch> |