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
If you are in the directory you want the contents of the git repository dumped to, run: | |
git clone git@github.com:whatever . | |
The "." at the end specifies the current folder as the checkout folder. |
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
// in .htaccess | |
<FilesMatch "\.(mov|mp3|mp4|wav|pdf)$"> | |
ForceType application/octet-stream | |
Header set Content-Disposition attachment | |
</FilesMatch> |
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
// make change to .gitignore | |
git rm --cached <filename> | |
// or, for all files | |
git rm -r --cached . | |
git add . | |
// then |
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 $page_contents = get_post(); | |
// use print_r if you want to see everything in the array | |
// print_r($page_contents); | |
$page_data = $page_contents->post_content; ?> | |
<div><?php echo $page_data ?></div> |
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
<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 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
// zip -e [archive] [file] | |
zip -e archivename.zip filetoprotect.txt |
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
function my_scripts_method() { | |
wp_deregister_script( 'jquery' ); | |
wp_register_script( 'jquery', get_template_directory_uri() . '/js/jquery-new.js'); | |
wp_enqueue_script( 'jquery' ); | |
} | |
add_action('wp_enqueue_scripts', 'my_scripts_method'); |
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
// in functions.php, check to see if there's more than one page: | |
function show_posts_pag() { | |
global $wp_query; | |
return ($wp_query -> max_num_pages > 1); | |
} | |
// on page:: | |
<?php if (show_posts_pag()) : ?> |
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
if( !is_admin()){ | |
wp_register_script('thescript', get_template_directory_uri() . '/path/to/thescript.js', array('jquery'), '1.2.3', true ); | |
} | |
function conditional_scripts() { | |
if( !is_admin() && is_page('somepage') ){ | |
wp_enqueue_script('thescript'); | |
} | |
} |
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
<a href="pdf_server.php?file=pdffilename">Download my pdf</a> | |
// pdf_server.php | |
header("Content-Type: application/octet-stream"); | |
$file = $_GET["file"] .".pdf"; | |
header("Content-Disposition: attachment; filename=" . urlencode($file)); | |
header("Content-Type: application/force-download"); |
NewerOlder