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
$(document).mouseup(function (e) | |
{ | |
var container = $("YOUR CONTAINER SELECTOR"); | |
if (!container.is(e.target) // if the target of the click isn't the container... | |
&& container.has(e.target).length === 0) // ... nor a descendant of the container | |
{ | |
container.hide(); | |
} | |
}); |
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="item-gallery"> | |
<?php query_posts('category_name=CATEGORY-NAME&posts_per_page=1'); ?> | |
<?php while (have_posts()) : the_post(); ?> | |
<div class="view"> | |
<?php the_post_thumbnail(); ?> | |
</div> | |
<div class="thumbnail"> | |
<ul> | |
<li> | |
<?php $meta = get_post_meta($post->ID, 'thumbnail' ); ?> |
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
$('.resizeme').keydown(function(){ | |
var contents = $(this).val(); | |
var charlength = contents.length; | |
newwidth = charlength*8; | |
$(this).css({width:newwidth}); | |
}); | |
//example <input type="text" class="resizeme" value="stuff goes here!"/> |
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 ( '' != get_the_post_thumbnail() ) { | |
?> | |
<!-- HTML CODE GOES HERE --> | |
<?php | |
} | |
else { | |
?> | |
<!-- HTML CODE GOES HERE --> | |
<?php |
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 | |
/* functions.php */ | |
function getPostViews($postID){ | |
$count_key = 'post_views_count'; | |
$count = get_post_meta($postID, $count_key, true); | |
if($count==''){ | |
delete_post_meta($postID, $count_key); | |
add_post_meta($postID, $count_key, '0'); | |
return "0 View"; | |
} |
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 | |
$id = #; | |
$post = get_page($id); | |
$content = apply_filters('the_content', $post->post_content); | |
echo $content; | |
?> |
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 echo get_the_post_thumbnail( $id, 'full' ); ?> |
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(!empty($post->post_excerpt)) {the_excerpt(); } ?> |
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
<form method="post"> | |
<input type="hidden" name="url" /> | |
<ul> | |
<li> | |
<input class="w-90p" type="text" placeholder="Email" name="email" id="emailAddress" /> | |
</li> | |
<li> | |
<textarea class="w-90p" name="message" placeholder="Write something..." id="messageText"></textarea> | |
</li> |
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 echo substr(strip_tags($post->post_content), 0, 150);?> |