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
<header class="entry-header row" <?php | |
if ( $thumbnail_id = get_post_thumbnail_id() ) { | |
if ( $image_src = wp_get_attachment_image_src( $thumbnail_id, 'x-large-size' ) ) | |
printf( ' style="background-image: url(%s);"', $image_src[0] ); | |
} | |
?>> |
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
/** | |
<div class="myBox"> | |
blah blah blah. | |
<a href="http://google.com">link</a> | |
</div> | |
*/ | |
$(".myBox").click(function(){ | |
window.location=$(this).find("a").attr("href"); | |
return false; |
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
var nextimage = "/images/some-image.jpg"; | |
$(document).ready(function(){ | |
window.setTimeout(function(){ | |
var img = $("<img>").attr("src", nextimage).load(function(){ | |
//all done | |
}); | |
}, 100); | |
}); |
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 | |
function twtreplace($content) { | |
$twtreplace = preg_replace('/([^a-zA-Z0-9-_&])@([0-9a-zA-Z_]+)/',"$1<a href=\"http://twitter.com/$2\" target=\"_blank\" rel=\"nofollow\">@$2</a>",$content); | |
return $twtreplace; | |
} | |
add_filter('the_content', 'twtreplace'); | |
add_filter('comment_text', 'twtreplace'); |
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 $recent = new WP_Query("page_id=**ID**"); while($recent->have_posts()) : $recent->the_post();?> | |
<h3><?php the_title(); ?></h3> | |
<?php the_content(); ?> | |
<?php endwhile; ?> |
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
// http://pippinsplugins.com/add-custom-image-sizes-to-media-uploader/ | |
function pw_add_image_sizes() { | |
add_image_size( 'pw-thumb', 300, 100, true ); | |
add_image_size( 'pw-large', 600, 300, true ); | |
} | |
add_action( 'init', 'pw_add_image_sizes' ); | |
function pw_show_image_sizes($sizes) { | |
$sizes['pw-thumb'] = __( 'Custom Thumb', 'pippin' ); |
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 if (have_posts()) : ?> | |
<?php $c = 0;while (have_posts()) : the_post(); $c++; | |
if( $c == 3) { | |
$style = 'third'; | |
$c = 0; | |
} | |
else $style=''; | |
// this goes in the loop | |
?> |
NewerOlder