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 ( has_post_thumbnail() ) :?> | |
<a href="<?php the_permalink() ?>" class="thumb"><?php the_post_thumbnail('thumbnail', array( | |
'alt' => trim(strip_tags( $post->post_title )), | |
'title' => trim(strip_tags( $post->post_title )), | |
)); ?></a> | |
<?php endif; ?> |
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
// let's create the function for the custom type | |
function custom_post_example() { | |
// creating (registering) the custom type | |
register_post_type( 'custom_type', /* (http://codex.wordpress.org/Function_Reference/register_post_type) */ | |
// let's now add all the options for this post type | |
array('labels' => array( | |
'name' => __('Custom Types', 'bonestheme'), /* This is the Title of the Group */ | |
'singular_name' => __('Custom Post', 'bonestheme'), /* This is the individual type */ | |
'all_items' => __('All Custom Posts', 'bonestheme'), /* the all items menu item */ | |
'add_new' => __('Add New', 'bonestheme'), /* The add new menu item */ |
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 | |
/** | |
* Post view Count | |
*/ | |
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0); | |
function wpb_set_post_views($postID) { | |
$count_key = 'wpb_post_views_count'; | |
$count = get_post_meta($postID, $count_key, true); | |
if($count==''){ | |
$count = 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
<?php if (($wp_query->current_post +1) == ($wp_query->post_count)) { | |
echo 'This is the last post'; | |
} ?> | |
<?php if (($wp_query->current_post +1) != ($wp_query->post_count)) { | |
echo 'This is the not the last post'; | |
} ?> |
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_post_meta($post->ID, 'single-bottom-ad', true)): ?> | |
<div id="single-bottom-ad"> | |
<?php echo get_post_meta($post->ID, 'single-bottom-ad', true); ?> | |
</div> | |
<?php endif; ?> |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |