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 settings | |
# do not display php errors which can give system and path info | |
php_value display_errors 0 | |
# uncomment for development | |
# php_value error_reporting 2047 | |
# php_value display_errors 1 |
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
stresspop | |
---------------------------------------------------------------------------- | |
the markup : | |
---------------------------------------------------------------------------- | |
<style> | |
#stresspop { display:none; width:572px; height:286px; | |
background:#fff; | |
position:fixed; | |
top:154px; |
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
<script> | |
$(document).ready(resizebg); | |
$(window).resize(resizebg); | |
function resizebg() { | |
var w,h,x,y; | |
var ratio = 4/3; | |
x = $(window).width(); | |
y = $(window).height(); | |
var constrain = x/y > ratio ? 'w' : 'h'; | |
if(constrain=='w') { |
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
// will take the alt tags from all input fields and make it the default text | |
// default text will disappear on focus and reappear on blur if field is blank | |
$('input').each(function(){ | |
$(this).click(function(){ if(this.type=='submit') this.blur(); }); | |
if(this.alt) { | |
this.value = this.alt; | |
this.onfocus=function(){if(this.value==this.alt){this.value='';} } | |
this.onblur=function(){if(this.value==''){this.value=this.alt;} } | |
} | |
}); |
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 fix_links() { | |
var domain = document.domain; | |
var http = new RegExp(/^http/); | |
$('a').each(function(){ | |
var href = $(this).attr('href'); | |
if( href.indexOf( domain )==-1 && http.test( href ) ) | |
$(this).attr('target',"_blank"); | |
}); | |
} |
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 | |
// get fb likes from fb graph api | |
// put this block in single.php, or somewhere you have $post and have setup postdata [inside a Loop] | |
$obj = json_decode( file_get_contents( 'http://graph.facebook.com/?id='.get_permalink() ) ); | |
$likes = $obj->shares; | |
update_post_meta($post->ID, '_fb_likes', $likes, false); | |
// make a Loop [in a template page or whatever] to query and display posts ordered by fb like popularity | |
$args = array( |
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 // quick WordPress custom URL variables for /en/page-name & /fr/page-name | |
function flush_rewrite() { | |
flush_rewrite_rules( false ); | |
} | |
add_action( 'init', 'flush_rewrite' ); | |
function my_insert_query_vars( $vars ) { | |
array_push( $vars, 'lang' ); | |
return $vars; |
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 | |
/* | |
* This class returns you an object that you can foreach() loop through, passing regular | |
* get_posts() args, and the results will be grouped by category or custom taxonomy. | |
* It's designed right now to work with posts in only one category [taxonomy term]. | |
* | |
* Usage: | |
$args = array( | |
'taxonomy' => 'my_taxonomy', |
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
add_action( 'init', 'sld_prepopulate' ); | |
function sld_prepopulate() { | |
$terms = array( | |
'term1', | |
'term2', | |
'Faculty' => array( | |
'booze', | |
'jeans', | |
), |
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
# directory listing shortcut | |
alias ll='ls -la' | |
# hardening wordpress file permissions shortcuts | |
alias setpermd='find . -type d -exec chmod 755 {} \;' | |
alias setpermf='find . -type f -exec chmod 644 {} \;' | |
# set vi as svn propeditor | |
export SVN_EDITOR=vi |
OlderNewer