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 | |
| // 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 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
| 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 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
| // 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 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
| <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 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
| stresspop | |
| ---------------------------------------------------------------------------- | |
| the markup : | |
| ---------------------------------------------------------------------------- | |
| <style> | |
| #stresspop { display:none; width:572px; height:286px; | |
| background:#fff; | |
| position:fixed; | |
| top:154px; |
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 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 |
NewerOlder